Repository navigation
ci: adopt public actions - #358
FangcatChina wants to merge 1 commit into
Conversation
24d14d5 to
63d35fe
Compare
63d35fe to
2e16582
Compare
2e16582 to
e7e6b61
Compare
| permissions: | ||
| contents: read | ||
| packages: write | ||
| id-token: write | ||
| attestations: write |
There was a problem hiding this comment.
Fine-grained permissions defined per job should be preferred.
| GH_TOKEN: ${{ github.token }} | ||
|
|
||
| build: | ||
| name: Build ${{ matrix.arch }} |
There was a problem hiding this comment.
Isn't the default name already informative enough? Removing it would better align with the single source of truth (SSOT) principle.
| path: ${{ runner.temp }}/digests/* | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
| - uses: vanilla-os/build-gh-action@main |
There was a problem hiding this comment.
It would be better to rename it to just vanilla-os/build-action, since the syntax is not used exclusively on GitHub.
There was a problem hiding this comment.
I named it with the -gh suffix to keep it consistent with our existing vib-gh-action. In that case, we need to rename it as well.
There was a problem hiding this comment.
I agree. Renaming would align it with the naming convention used by most actions, such as docker/build-push-action and golangci/golangci-lint-action. However, we should handle the rename carefully to avoid breaking existing users. The transition from actions/attest-build-provenance to actions/attest is a good example to follow.
| differ: | ||
| runs-on: ubuntu-latest | ||
| if: github.repository == 'vanilla-os/desktop-image' && github.ref_type == 'tag' | ||
| name: Differ | ||
| needs: merge | ||
| if: github.repository == 'vanilla-os/desktop-image' && github.ref_type == 'tag' | ||
| runs-on: ubuntu-26.04 | ||
| container: | ||
| image: ghcr.io/vanilla-os/gnome:latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Generate package diff | ||
| run: | | ||
| lpkg --unlock | ||
| PACKAGE_LIST=$(.github/gen_package_list.sh) | ||
| apt-get install -y curl | ||
| IMAGE_DIGEST=$(curl -s -L -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| https://api.github.com/orgs/Vanilla-OS/packages/container/gnome/versions | grep -m1 name | sed -E 's/^\s*"name": "(.+)".*$/\1/') | ||
| curl -X POST \ | ||
| -H 'Accept:application/json' \ | ||
| -H "Authorization:Basic $(echo -n "${{ secrets.DIFFER_USER }}:${{ secrets.DIFFER_PSW }}" | base64)" \ | ||
| -d "{\"digest\":\"${IMAGE_DIGEST}\",${PACKAGE_LIST}}" \ | ||
| ${{ vars.DIFFER_URL }}/images/desktop/new | ||
| curl -X POST \ | ||
| -H 'Accept:application/json' \ | ||
| -H "Authorization:Basic $(echo -n "${{ secrets.DIFFER_USER }}:${{ secrets.DIFFER_PSW }}" | base64)" \ | ||
| -d "{\"digest\":\"${IMAGE_DIGEST}\",${PACKAGE_LIST}}" \ | ||
| ${{ vars.DIFFER_URL }}/images/gnome/new | ||
| lpkg --lock | ||
| - uses: vanilla-os/differ-gh-action@main | ||
| with: | ||
| image: gnome | ||
| legacy_image: desktop | ||
| differ_url: ${{ vars.DIFFER_URL }} | ||
| differ_user: ${{ secrets.DIFFER_USER }} | ||
| differ_psw: ${{ secrets.DIFFER_PSW }} No newline at end of file |
There was a problem hiding this comment.
The current differ job is incompatible with multi-arch images, since different architectures contain different packages. To display package information correctly, it would be better to generate an SBOM in build-action for each architecture, eliminating the need for a separate differ-action.
Depends on Vanilla-OS/differ-gh-action#1, resolves #346, should be merged along with Vanilla-OS/core-image#175
The public actions build images using Buildah with zstd:chunked enabled by default, in order to standardize and simplify our build process.
The actions have been tested in:
Branch rules may need to be updated to adapt new names.