mirror of
https://github.com/flatulentfowl/docdrop.git
synced 2026-07-22 06:49:52 +00:00
Add GitHub Actions workflow with artifact attestation for releases
- Create build job that compiles main.js and styles.css - Add attest job using actions/attest-build-provenance for both assets - Create release job that publishes artifacts with their attestations - Enables users to cryptographically verify release asset provenance
This commit is contained in:
parent
e1f3803aea
commit
b8a30eba3e
1 changed files with 82 additions and 0 deletions
82
.github/workflows/release.yml
vendored
Normal file
82
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
main-js-path: ${{ steps.build.outputs.main-js-path }}
|
||||
styles-css-path: ${{ steps.build.outputs.styles-css-path }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
|
||||
- id: build
|
||||
run: |
|
||||
echo "main-js-path=main.js" >> $GITHUB_OUTPUT
|
||||
echo "styles-css-path=styles.css" >> $GITHUB_OUTPUT
|
||||
|
||||
attest:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
|
||||
- name: Attest build provenance for main.js
|
||||
uses: actions/attest-build-provenance@v1
|
||||
with:
|
||||
subject-path: main.js
|
||||
|
||||
- name: Attest build provenance for styles.css
|
||||
uses: actions/attest-build-provenance@v1
|
||||
with:
|
||||
subject-path: styles.css
|
||||
|
||||
release:
|
||||
needs: [build, attest]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
main.js
|
||||
styles.css
|
||||
manifest.json
|
||||
Loading…
Reference in a new issue