-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (110 loc) · 3.49 KB
/
release.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Release
on:
workflow_dispatch:
push:
tags:
- v*
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
download:
name: Download image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load settings
run: source settings.sh
- id: cache
name: Cache
uses: actions/cache@v4
with:
key: ${{ env.GIT_CACHE_NAME }}
path: ${{ env.IMAGE_FILENAME }}
- name: Download Debian genericcloud image
run: wget "$DEBIAN_FILEURL"
if: steps.cache.outputs.cache-hit != 'true'
release:
name: Create release
needs: download
runs-on: ubuntu-latest
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load settings
run: source settings.sh
- name: Test
run: |
gh release list |
grep "v${DEBIAN_VERSION}-${DEBIAN_RELEASE}" ||
gh release create "v${DEBIAN_VERSION}-${DEBIAN_RELEASE}" \
--repo="${GITHUB_REPOSITORY}" \
--title="v${DEBIAN_VERSION}-${DEBIAN_RELEASE}" \
--latest \
--draft
# customize:
# name: Customize image
# needs: download
# runs-on: ubuntu-latest
# strategy:
# matrix:
# variant: [qemu, locales, extras]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Load settings
# run: source settings.sh
# - name: Load cached files
# uses: actions/cache@v4
# with:
# key: ${{ env.GIT_CACHE_NAME }}
# path: ${{ env.IMAGE_FILENAME }}
# - name: Install libguestfs
# run: sudo apt-get install -y libguestfs-tools
# - name: Rebuild image
# run: ./customize.sh ${{ env.IMAGE_FILENAME }} ${{ matrix.variant }}
# - name: Compress image artifact
# run: |
# sudo virt-sparsify ${{ env.IMAGE_FILENAME }} \
# --compress ${{ env.ARTIFACT_NAME }}
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.ARTIFACT_NAME }}
# path: ${{ env.ARTIFACT_NAME }}
# retention-days: 1
# release:
# name: Create release
# needs: customize
# runs-on: ubuntu-latest
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# if: startsWith(github.ref, 'refs/tags/')
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Load settings
# run: source settings.sh
# - name: Load cached files
# uses: actions/cache@v4
# with:
# key: ${{ env.GIT_CACHE_NAME }}
# path: ${{ env.IMAGE_FILENAME }}
# - name: Download all workflow run artifacts
# uses: actions/download-artifact@v4
# with:
# merge-multiple: true
# - name: Create release draft
# run: |
# gh release create "${GITHUB_REF_NAME}" \
# --repo="${GITHUB_REPOSITORY}" \
# --title="${GITHUB_REF_NAME}" \
# --verify-tag \
# --latest \
# --draft
# - name: Upload original image artifact
# run: gh release upload "${GITHUB_REF_NAME}" *.qcow2 --clobber
# - run: echo "### Finished! :rocket:" >> $GITHUB_STEP_SUMMARY