Skip to content

Commit

Permalink
chore: automate release (#40)
Browse files Browse the repository at this point in the history
* automate release

* release only on workflow dispatch

* fix typo and remove log file
  • Loading branch information
shubhbapna authored May 5, 2023
1 parent 656e776 commit bf5321c
Show file tree
Hide file tree
Showing 4 changed files with 11,461 additions and 3,514 deletions.
40 changes: 15 additions & 25 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Publish

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "package.json"
on: workflow_dispatch

jobs:
build:
release:
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
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,23 +17,14 @@ jobs:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: check for version change
id: version-check
uses: EndBug/version-check@v2
with:
file-url: https://unpkg.com/@kie/act-js@latest/package.json
static-checking: localIsNew

- run: npm ci
if: steps.version-check.outputs.changed == 'true'
- name: Install packages
run: npm ci

- run: npm run build
if: steps.version-check.outputs.changed == 'true'
- name: Build package
run: npm run build

- run: npm publish --access public
if: steps.version-check.outputs.changed == 'true'
- name: Release
run: npx semantic-release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- run: echo "No version change detected in package.json. Won't publish"
if: steps.version-check.outputs.changed == 'false'
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit bf5321c

Please sign in to comment.