Skip to content

Commit

Permalink
build: update release process
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Apr 21, 2023
1 parent fa86f6c commit 29e81a3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: NPM Publish
name: Release

on:
release:
types: [published]
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+']

jobs:
publish:
build:
uses: ./.github/workflows/build.yml

npm:
needs:
- build
runs-on: ubuntu-latest
continue-on-error: true
permissions:
Expand Down Expand Up @@ -43,9 +48,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

push:
cleanup:
needs:
- publish
- npm
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -61,3 +66,21 @@ jobs:
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "chore: cleanup after publish"
- run: git push origin HEAD:main

github:
needs:
- npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: node tools/release-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 0 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,29 +242,3 @@ jobs:
run: npm install --global electron
- name: Run Test Suite
run: npm run tap:electron

prepare-release:
needs:
- browsers
- bun
- deno
- edge-runtime
- electron
- node
- typings
- workers
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository == 'panva/jose' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen # 18
cache: 'npm'
- run: node tools/release-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion tools/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fs.writeFileSync(
.join('\n'),
)

execSync(`gh release create ${tag} -dF notes.md`)
execSync(`gh release create ${tag} -F notes.md --discussion-category Releases`)

0 comments on commit 29e81a3

Please sign in to comment.