Skip to content

Commit

Permalink
ci: updated semantic-release in to step with different node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed Jul 23, 2024
1 parent 68a9118 commit 8aeb16f
Showing 1 changed file with 48 additions and 11 deletions.
59 changes: 48 additions & 11 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ permissions:
contents: "read" # for checkout

jobs:
semantic-release:
name: "Semantic Release"
build:
name: "Build Package"
if: "github.repository == 'anolilab/unplugin-favicons'"
runs-on: "ubuntu-latest"
permissions:
contents: "write" # to be able to publish a GitHub release
issues: "write" # to be able to comment on released issues
pull-requests: "write" # to be able to comment on released pull requests
id-token: "write" # to enable use of OIDC for npm provenance

steps:
- name: "Harden Runner"
Expand Down Expand Up @@ -71,6 +66,51 @@ jobs:
# run-lint: "false"
# codecov-token: "${{ secrets.CODECOV_TOKEN }}"

- name: "Publish Build Artifacts"
uses: "actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b" # v4.3.4
with:
name: "unplugin-favicons-dist"
path: "${{ github.workspace }}/dist"

semantic-release:
name: "Semantic Release"
needs: ["build"]
runs-on: "ubuntu-latest"
permissions:
contents: "write" # to be able to publish a GitHub release
issues: "write" # to be able to comment on released issues
pull-requests: "write" # to be able to comment on released pull requests
id-token: "write" # to enable use of OIDC for npm provenance

steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142" # v2.7.0
with:
egress-policy: "audit"

- name: "Git checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
with:
fetch-depth: 0
persist-credentials: false
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"

- name: "Setup resources and environment"
id: "setup"
uses: "anolilab/workflows/step/setup@main"
with:
node-version: "20.x"
cache-prefix: "semantic-release"

- name: "Download Build Artifacts"
uses: "actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16" # v4.1.8
with:
name: "unplugin-favicons-dist"
path: "${{ github.workspace }}/dist"

- name: "Semantic Release"
if: "success()"
env:
Expand All @@ -80,7 +120,4 @@ jobs:
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
GIT_COMMITTER_NAME: "github-actions-shell"
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
run: |
nvm install 20.8.1
nvm use 20.8.1
pnpm exec semantic-release
run: "pnpm exec semantic-release"

0 comments on commit 8aeb16f

Please sign in to comment.