-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (79 loc) · 2.83 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Create Release
on:
workflow_dispatch:
inputs:
tag:
description: 'The next release tag to use'
required: false
type: string
push:
branches:
- 'main'
tags:
- 'v*'
# Ensures that only one deploy task per branch/environment will run at a time.
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
install: true
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
# - name: Env
# run: |
# # ACTIONS_RUNTIME_TOKEN, ACTIONS_RUNTIME_URL should be exposed
# env|sort
- name: Check out the repository to the runner
uses: actions/checkout@v4
# - name: Set up caching
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
# uses: jpribyl/[email protected]
# # Ignore the failure of a step and avoid terminating the job.
# continue-on-error: true
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ inputs.tag }}
- name: Build the builder
run: ./zquickinit.sh builder --githubaction --load
- name: Push OCI package to registry
run: ./zquickinit.sh builder --githubaction --push --tag ghcr.io/midzelis/zquickinit:latest --tag ghcr.io/midzelis/zquickinit:${{ steps.tag_version.outputs.new_tag }}
- name: Build initramfs
run: ./zquickinit.sh initramfs --noask --release
- name: Build ISO
run: sudo apt-get install -y mtools xorriso coreutils findutils && ./zquickinit.sh iso
- name: Create a GitHub release
uses: ncipollo/[email protected]
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
removeArtifacts: true
artifacts: "output/zquickinit.efi,zquickinit.iso"
allowUpdates: true