Skip to content

Commit

Permalink
update pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
tsndr committed Oct 27, 2024
1 parent cce5a61 commit fdaa618
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish
run-name: Publish ${{ github.ref_name }}

on:
release:
types: [published]
types: [ published ]

jobs:
publish:
Expand All @@ -13,18 +14,27 @@ jobs:
with:
node-version: latest
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build
run: npm run build

- name: Publish to npmjs
run: npm publish --tag latest --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --tag ${{ contains(github.ref_name, '-') && 'pre' || 'latest' }} --access public

- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://npm.pkg.github.com/

- name: Publish to GPR
run: npm publish --tag latest --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --tag ${{ contains(github.ref_name, '-') && 'pre' || 'latest' }} --access public
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
run-name: Release ${{ github.ref_name }}

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build
run: npm run build

- name: Create release
run: gh release create ${{ github.ref_name }} --draft ${{ contains(github.ref_name, '-') && '--prerelease --latest=false' || '--latest' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ jobs:
with:
node-version: latest
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
run: npm test

- name: Build
run: npm run build

0 comments on commit fdaa618

Please sign in to comment.