Bump to version 0.0.12 #172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a basic workflow to help you get started with Actions | |
| name: CI | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| # events but only for the master branch | |
| on: | |
| push: | |
| branches: [ "**" ] | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: [ master ] | |
| workflow_call: | |
| workflow_dispatch: | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| # This workflow contains a single job called "build" | |
| build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.set-version.outputs.version }} | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v2 | |
| - name: Set version | |
| id: set-version | |
| run: | | |
| source version.sh | |
| echo "version=$version" >> $GITHUB_ENV | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| echo "suite=$suite" >> $GITHUB_ENV | |
| echo $version | |
| - name: Install dependencies | |
| run: sudo apt-get -y install dpkg-dev fakeroot debhelper python3-all dh-python lintian devscripts python3-hatchling pybuild-plugin-pyproject build-essential | |
| - name: Build the deb | |
| run: | | |
| python3 other/generate_changelog.py | |
| dpkg-parsechangelog -l debian/changelog | |
| dpkg-buildpackage -uc -us | |
| mkdir -p output | |
| mv ../grub-reboot-picker_${version}* output/ | |
| - name: Lint the deb | |
| run: | | |
| cd output | |
| # Run a lint against this deb, check for errors | |
| lintian grub-reboot-picker_${version}_all.deb | |
| - name: Inspect the deb | |
| run: | | |
| cd output | |
| # Look at information about this deb | |
| dpkg -I grub-reboot-picker_${version}_all.deb | |
| # List all the files in the deb | |
| dpkg -c grub-reboot-picker_${version}_all.deb | |
| # Extract contents to a dir | |
| dpkg-deb -R grub-reboot-picker_${version}_all.deb extracted/ | |
| # View changelog | |
| zless extracted/usr/share/doc/grub-reboot-picker/changelog.gz | |
| rm -rf extracted/ | |
| # View its dependencies | |
| dpkg-deb -f grub-reboot-picker_${version}_all.deb Depends | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: grub-reboot-picker_${{ steps.set-version.outputs.version }}_all.deb | |
| path: output/grub-reboot-picker_${{ steps.set-version.outputs.version }}_all.deb | |
| retention-days: 7 | |
| create-release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v5 | |
| - name: Cosign Attestation of the DEB | |
| uses: actions/attest-build-provenance@v1 | |
| id: attest | |
| with: | |
| subject-path: grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb | |
| - name: Rename cosign bundle | |
| run: | | |
| mv ${{ steps.attest.outputs.bundle-path }} grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb.cosign.bundle | |
| ls -lah | |
| - name: Get LOGINDEX | |
| id: logindex | |
| run: | | |
| logIndex=$(jq -r '.verificationMaterial.tlogEntries[0].logIndex' < grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb.cosign.bundle) | |
| echo "REKOR_LOGINDEX=$logIndex" >> "$GITHUB_OUTPUT" | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb.cosign.bundle | |
| path: grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb.cosign.bundle | |
| retention-days: 7 | |
| - name: Generate Release Notes | |
| run: | | |
| # Extract the changelog from the deb | |
| dpkg-deb -R grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb extracted/ | |
| # Gets changelog, removes the first version line and the last signature line. | |
| zless extracted/usr/share/doc/grub-reboot-picker/changelog.gz | sed '/-- Mendhak/,$d' | tail -n +2 > ${{ github.workspace }}-CHANGELOG.txt | |
| echo 'Verification:' >> ${{ github.workspace }}-CHANGELOG.txt | |
| echo '```' >> ${{ github.workspace }}-CHANGELOG.txt | |
| echo "cosign verify-blob grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb --bundle grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb.cosign.bundle --new-bundle-format --cert-oidc-issuer https://token.actions.githubusercontent.com --cert-identity https://github.com/${{ github.workflow_ref }}" >> ${{ github.workspace }}-CHANGELOG.txt | |
| echo '```' >> ${{ github.workspace }}-CHANGELOG.txt | |
| echo '' >> ${{ github.workspace }}-CHANGELOG.txt | |
| echo "[Rekor transparency log](https://search.sigstore.dev?logIndex=${{ steps.logindex.outputs.REKOR_LOGINDEX }})" >> ${{ github.workspace }}-CHANGELOG.txt | |
| - name: Upload to GitHub Releases | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| make_latest: true | |
| files: | | |
| grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb | |
| grub-reboot-picker_${{ needs.build.outputs.version }}_all.deb.cosign.bundle | |
| tag_name: ${{ github.ref_name}} | |
| name: Release ${{ github.ref_name}} | |
| body_path: ${{ github.workspace }}-CHANGELOG.txt |