Skip to content

Commit

Permalink
try to automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Dec 20, 2023
1 parent a213d7c commit 79b9b61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Node.js
on:
push:
branches: [ "main" ]
tags: [ '*' ]
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -60,14 +59,11 @@ jobs:
path: getargv.js/pkg/*

release:
if: ${{ github.ref_type == 'tag' }}
needs: [ test ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
path: pkg
- uses: softprops/action-gh-release@v1
with:
files: pkg/pack-*/*
name: ${{ github.ref_name }}
- uses: actions/checkout@v4
- name: Bump Version
run: npm version minor
- name: Push tag
run: git push tag
13 changes: 8 additions & 5 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,31 @@
name: NPM Package

on:
release:
types: [created]
push:
tags: [ '*' ]

jobs:
publish-gpr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

publish-npm:
runs-on: macos-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -34,12 +37,12 @@ jobs:
- name: Build libgetargv
run: make install_dylib
working-directory: getargv
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 79b9b61

Please sign in to comment.