From 23d5b9b540a5fb8df77fae2b6ad8bb2e6f91f4b5 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 17 Sep 2024 00:10:34 +0800 Subject: [PATCH] ci: add artifact attestation (#444) --- .github/workflows/build.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10cdcb581..0c4b801a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,11 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] + permissions: + id-token: write + contents: write + attestations: write + steps: - name: Check out Git repository Fully uses: actions/checkout@v4 @@ -140,14 +145,29 @@ jobs: path: | out/make/**/*.dmg retention-days: 90 + + - name: Generate artifact attestation + if: github.ref_type == 'tag' || github.event.inputs.tag_version != '' + continue-on-error: true + uses: actions/attest-build-provenance@v1 + with: + subject-path: | + out/make/**/*.dmg + out/make/**/*.zip + out/make/**/*.exe + out/make/**/*.AppImage + out/make/**/*.yml + - run: npx changelogithub if: github.ref_type == 'tag' || github.event.inputs.tag_version != '' continue-on-error: true env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Version id: version uses: ./.github/actions/setup-version + - name: Create Release Draft if: github.ref_type == 'tag' || github.event.inputs.tag_version != '' uses: softprops/action-gh-release@v2