Merge pull request #135 from baptistecdr/renovate/node-22.x #356
This file contains 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
name: Build | |
on: | |
- push | |
env: | |
ARTIFACTS_DIR: ${{ vars.ARTIFACTS_DIR }} | |
ARTIFACT_NAME: release-chrome-extension | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
attestations: write | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Lint | |
run: yarn lint | |
- name: Package | |
run: yarn package | |
- name: Commit package | |
uses: EndBug/add-and-commit@v9 | |
with: | |
fetch: true | |
default_author: github_actions | |
message: Update dist | |
pathspec_error_handling: exitImmediately | |
push: true | |
- name: Upload package | |
id: upload-package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ./dist/ | |
- name: Download artifact | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
mkdir "$ARTIFACTS_DIR" | |
gh api /repos/${{ github.repository }}/actions/artifacts/${{ steps.upload-package.outputs.artifact-id }}/zip > "$ARTIFACTS_DIR/$ARTIFACT_NAME.zip" | |
- name: Attest artifact | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: | | |
${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_NAME }}.zip |