Skip to content

Commit

Permalink
chore(release.yml): simplify release workflow and update Node.js setup
Browse files Browse the repository at this point in the history
chore(package.json): add @semantic-release/commit-analyzer dependency
  • Loading branch information
neopromic committed Jan 9, 2025
1 parent 25a574e commit ee19b13
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 41 deletions.
55 changes: 19 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
name: Semantic Release

name: Release
on:
push:
branches:
- main
- dev/*
- feature/*
- hotfix/*

jobs:
semantic-release:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
permissions:
contents: read

name: Semantic Release
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write

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: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Prepare prerelease semantic
if: github.ref != 'refs/heads/main'
run: mv .releaserc.prerelease.yaml .releaserc.yaml

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
with:
semantic_version: 17
extra_plugins: |
@semantic-release/changelog@5
@semantic-release/exec@5
@semantic-release/git@9
- name: "Install pnpm"
run: "npm i pnpm@latest -g"
- name: Install dependencies
run: pnpm clean-install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Do something when a new release published
if: steps.semantic.outputs.new_release_published == 'true'
run: |
echo ${{ steps.semantic.outputs.new_release_version }}
echo ${{ steps.semantic.outputs.new_release_major_version }}
echo ${{ steps.semantic.outputs.new_release_minor_version }}
echo ${{ steps.semantic.outputs.new_release_patch_version }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpx semantic-release
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-slot": "^1.1.0",
"@semantic-release/commit-analyzer": "^13.0.1",
"@stripe/stripe-js": "^5.2.0",
"@tanstack/react-table": "^8.20.5",
"@types/canvas-confetti": "^1.9.0",
Expand Down
13 changes: 8 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee19b13

Please sign in to comment.