@@ -33,17 +33,43 @@ jobs:
3333 contents : write
3434
3535 steps :
36+ - name : Prepare SSH key
37+ shell : bash
38+ run : |
39+ mkdir -p ~/.ssh
40+ echo "${{secrets.GITEA_DEPLOY_KEY}}" > ~/.ssh/gitea_deploy_key
41+ sed -i 's/\r//' ~/.ssh/gitea_deploy_key
42+ chmod 600 ~/.ssh/gitea_deploy_key
43+ echo -e "\n
44+ Host git.3mdeb.com\n
45+ HostName git.3mdeb.com\n
46+ StrictHostKeyChecking no\n
47+ UserKnownHostsFile /dev/null\n
48+ IdentityFile ~/.ssh/gitea_deploy_key\n
49+ IdentitiesOnly yes" > ~/.ssh/config_deploy
50+
3651 - name : Install dependencies of builder script
3752 # docker.io was changed to docker because of conflict on containerd
3853 run : |
3954 sudo apt install --no-install-recommends --yes \
40- createrepo-c devscripts python3-docker reprepro \
41- python3-pathspec mktorrent python3-lxml python3-dateutil
55+ createrepo-c devscripts gpg python3-docker reprepro \
56+ python3-pathspec mktorrent python3-lxml python3-dateutil \
57+
58+ - name : Compile sq
59+ run : |
60+ sudo apt install --no-install-recommends --yes \
61+ build-essential capnproto clang curl git libassuan-dev libbz2-dev \
62+ libgpgme-dev libnpth-dev libsqlite3-dev libssl-dev nettle-dev \
63+ pkg-config zlib1g-dev && \
64+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
65+ source "$HOME/.cargo/env" && \
66+ cargo install --version 1.3.1 --locked sequoia-sq && \
67+ sudo mv "$HOME/.cargo/bin/sq" /usr/local/bin/
4268
4369 - uses : actions/checkout@v4
4470 with :
4571 repository : QubesOS/qubes-builderv2
46- ref : 80dd898cc0472dd99f161f1d1c7c44da64de93f2
72+ ref : 5327e41b3d68befc61bee87fb1ac0033662d575f
4773 fetch-depth : 0
4874
4975 - name : Cache Docker image and dom0 stuff
@@ -184,6 +210,15 @@ jobs:
184210 cat builder.yml
185211 echo "::endgroup::"
186212
213+ - name : Disable AppArmor
214+ # Ubuntu runner with Fedora 42 Docker container fails due to AppArmor:
215+ # https://github.com/fedora-cloud/docker-brew-fedora/issues/117
216+ uses : cisagov/action-disable-apparmor@v1
217+
218+ - name : Disable kernel.apparmor_restrict_unprivileged_userns
219+ # See the AppArmor failures above
220+ run : sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
221+
187222 - name : Build and package
188223 env :
189224 DEBUG : ${{ runner.debug == 1 && '--debug --verbose' || '' }}
@@ -199,17 +234,11 @@ jobs:
199234 name : qubesos.dom0.fc37-${{ inputs.qubes-component }}-${{ github.sha }}
200235 path : ' *.rpm'
201236
202- - name : Construct release's description
237+ - name : Construct commands for transfer
203238 if : github.event_name == 'push' && github.ref_type == 'tag'
204239 run : |
205240 for artifact in *.rpm; do
206- echo "### $artifact" >> release-body.md
207- echo '```' >> release-body.md
208241 echo "wget --quiet '${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/$artifact'" >> release-body.md
209- echo '```' >> release-body.md
210- echo '```' >> release-body.md
211- echo "curl --remote-name '${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/$artifact'" >> release-body.md
212- echo '```' >> release-body.md
213242 done
214243
215244 - name : Create release for a new tag
@@ -219,3 +248,30 @@ jobs:
219248 artifacts : ' *.rpm'
220249 artifactErrorsFailBuild : true
221250 bodyFile : " release-body.md"
251+
252+ - name : Run Gitea workflow
253+ shell : bash
254+ run : |
255+ git config --global user.email "robot@3mdeb.com"
256+ git config --global user.name "3mdeb Robot"
257+ GIT_SSH_COMMAND='ssh -F ~/.ssh/config_deploy' git clone ssh://git@git.3mdeb.com:2222/zarhus/trenchboot-release-cicd-pipeline.git
258+ cd trenchboot-release-cicd-pipeline
259+ cp ../release-body.md .
260+ git add release-body.md
261+ git commit -m "Signing release ${{ github.ref_name }}"
262+ GIT_SSH_COMMAND='ssh -F ~/.ssh/config_deploy' git push origin devel
263+ git tag "${{ github.ref_name }}"
264+ GIT_SSH_COMMAND='ssh -F ~/.ssh/config_deploy' git push origin "${{ github.ref_name }}"
265+ cd -
266+
267+ cleanup :
268+ name : Cleanup
269+ runs-on : ubuntu-24.04
270+ needs : build-and-package
271+ if : always()
272+ steps :
273+ - name : Cleanup after deployment
274+ shell : bash
275+ run : |
276+ rm -f ~/.ssh/gitea_deploy_key
277+ rm -rf trenchboot-release-cicd-pipeline
0 commit comments