|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-artifacts: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + container: |
| 12 | + image: ghcr.io/vanilla-os/pico:main |
| 13 | + volumes: |
| 14 | + - /proc:/proc |
| 15 | + - /:/run/host |
| 16 | + options: --privileged -it |
| 17 | + permissions: |
| 18 | + contents: read |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: De-bloat stock image |
| 24 | + run: | |
| 25 | + rm -r /run/host/usr/share/dotnet |
| 26 | + rm -r /run/host${{ runner.tool_cache }} |
| 27 | + |
| 28 | + - name: Install needed packages |
| 29 | + run: apt update && apt install dpkg-dev build-essential debhelper librsvg2-bin optipng -y |
| 30 | + |
| 31 | + - name: Build Debian package |
| 32 | + run: | |
| 33 | + dpkg-buildpackage --no-sign |
| 34 | + mv ../*.deb ../desktop-base.deb |
| 35 | + |
| 36 | + - name: Calculate and Save Checksums |
| 37 | + run: | |
| 38 | + sha256sum /__w/desktop-base/desktop-base.deb >> checksums.txt |
| 39 | + |
| 40 | + - uses: actions/upload-artifact@v4 |
| 41 | + with: |
| 42 | + name: desktop-base |
| 43 | + path: | |
| 44 | + /__w/desktop-base/desktop-base.deb |
| 45 | + checksums.txt |
| 46 | +
|
| 47 | + release: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + needs: build-artifacts |
| 50 | + permissions: |
| 51 | + contents: write # to create and upload assets to releases |
| 52 | + attestations: write # to upload assets attestation for build provenance |
| 53 | + id-token: write # grant additional permission to attestation action to mint the OIDC token permission |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Checkout |
| 57 | + uses: actions/checkout@v4 |
| 58 | + with: |
| 59 | + fetch-depth: 0 |
| 60 | + |
| 61 | + - name: Download Artifact |
| 62 | + uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + name: desktop-base |
| 65 | + |
| 66 | + - name: Create Release |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + run: gh release create "${{ github.ref_name }}" --generate-notes *.deb desktop-base/checksums.txt |
| 70 | + |
| 71 | + - name: Attest Release Files |
| 72 | + id: attest |
| 73 | + uses: actions/attest-build-provenance@v1 |
| 74 | + with: |
| 75 | + subject-path: '*.deb, desktop-base/*.txt' |
0 commit comments