-
Notifications
You must be signed in to change notification settings - Fork 13
165 lines (139 loc) · 5.1 KB
/
release.yaml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Build and publish a release of InputPlumber using semantic-release whenever
# changes are merged into main.
name: "🎉 Release"
on:
push:
branches:
- main
- v0.x
- v1.x
paths-ignore:
- README.md
- "docs/**"
# Jobs to run
jobs:
release:
name: 🎉 Publish to GitHub
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "20"
- name: Install Dependencies
run: npm install @semantic-release/exec @google/semantic-release-replace-plugin @semantic-release/git
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make sem-release
# In ".releaserc.yaml" a step is defined to write the release version to
# ".version.txt" upon successful release. This step checks to see if that
# exists to determine if the other jobs need to run.
- id: status
name: Set release status
shell: bash
run: |
if [ -f .version.txt ]; then
echo "was_released=yes" >> "$GITHUB_OUTPUT"
else
echo "was_released=no" >> "$GITHUB_OUTPUT"
fi
# Upload the package build for the AUR publish step
- name: Upload PKGBUILD
uses: actions/upload-artifact@v4
if: steps.status.outputs.was_released == 'yes'
with:
name: PKGBUILD
path: ./pkg/archlinux/PKGBUILD
if-no-files-found: error
- name: Upload Release Version
uses: actions/upload-artifact@v4
if: steps.status.outputs.was_released == 'yes'
with:
name: version.txt
path: .version.txt
if-no-files-found: error
include-hidden-files: true
outputs:
should_publish: ${{ steps.status.outputs.was_released }}
publish-to-copr:
name: 🟤 Publish to COPR
needs: release
if: needs.release.outputs.should_publish == 'yes'
runs-on: ubuntu-latest
steps:
- name: Trigger COPR Build
run: curl -X POST ${{ secrets.COPR_WEBHOOK_URL }}
publish-to-aur:
name: 🐧 Publish to AUR
needs: release
if: needs.release.outputs.should_publish == 'yes'
runs-on: ubuntu-latest
steps:
- name: Download PKGBUILD
uses: actions/download-artifact@v4
with:
name: PKGBUILD
- name: Download Release Version
uses: actions/download-artifact@v4
with:
name: version.txt
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v3
with:
host: aur.archlinux.org
private-key: ${{ secrets.AUR_SSH_KEY }}
- name: Checkout AUR bin
run: git clone ssh://[email protected]/inputplumber-bin.git
- name: Copy PKGBUILD to bin repo
run: cp ./PKGBUILD inputplumber-bin/
- name: Build bin package
working-directory: inputplumber-bin
run: make in-docker
- name: Commit and publish bin package
shell: bash
working-directory: inputplumber-bin
run: |
git config user.name "github-actions[bot]"
git config user.email "shadowblip+github-actions[bot]@users.noreply.github.com"
git add .SRCINFO PKGBUILD
git commit -m "Update to $(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)"
git push origin master
- name: Checkout AUR git
run: git clone ssh://[email protected]/inputplumber-git.git
- name: Build git package
working-directory: inputplumber-git
run: make in-docker
- name: Commit and publish git package
shell: bash
working-directory: inputplumber-git
run: |
git config user.name "github-actions[bot]"
git config user.email "shadowblip+github-actions[bot]@users.noreply.github.com"
git add .SRCINFO PKGBUILD
git commit -m "Update to $(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)"
git push origin master
- name: Checkout AUR
run: git clone ssh://[email protected]/inputplumber.git
- name: Copy Makefile from git package and update PKGBUILD
run: |
cp inputplumber-git/Makefile inputplumber/Makefile
cp inputplumber-git/Dockerfile inputplumber/Dockerfile
curl -sL https://github.com/ShadowBlip/InputPlumber/archive/refs/tags/v$(cat .version.txt).tar.gz | sha256sum | cut -d' ' -f1 > hash.txt
sed -i "s/^pkgver=.*/pkgver=$(cat .version.txt)/g" inputplumber/PKGBUILD
sed -i "s/^sha256sums=.*/sha256sums=('$(cat hash.txt)')/g" inputplumber/PKGBUILD
- name: Build package
working-directory: inputplumber
run: |
make in-docker
- name: Commit and publish package
shell: bash
working-directory: inputplumber
run: |
git config user.name "github-actions[bot]"
git config user.email "shadowblip+github-actions[bot]@users.noreply.github.com"
git add .SRCINFO PKGBUILD
git commit -m "Update to $(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)"
git push origin master