Skip to content

Commit

Permalink
Merge pull request #5 from herberthk/create-new-release-workflow
Browse files Browse the repository at this point in the history
chore: created new release workflow
  • Loading branch information
herberthk authored Oct 2, 2024
2 parents 174f355 + d2c1c7b commit ad45c38
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Build and Test
on:
push:
branches:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

# This will trigger the workflow when a pull request is merged into main.
on:
push:
pull_request:
branches:
- main
workflow_run:
workflows: ["Build and Test"] # Name of the triggering workflow
types:
- completed # Run this workflow when the 'Build and Test' workflow completes


jobs:
release:
runs-on: ubuntu-latest
# Only run if the build and test workflow succeeds
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

# Run release-it to publish package to npm and create a GitHub release
- name: Publish package and create GitHub release
run: npx release-it --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,16 @@
"git": {
"commitMessage": "chore: release ${version}",
"tagName": "v${version}",
"requireCleanWorkingDir": true
"requireCleanWorkingDir": true,
"tagAnnotation": "Release v${version}"
},
"npm": {
"publish": true,
"access": "public"
},
"github": {
"release": true
"release": true,
"releaseName": "Release v${version}"
},
"plugins": {
"@release-it/conventional-changelog": {
Expand Down

0 comments on commit ad45c38

Please sign in to comment.