Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auto publish workflow on new tag, release #78

Merged
merged 11 commits into from
Apr 27, 2023
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish to NPM
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
release:
types: [released]

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "14"
registry-url: 'https://registry.npmjs.org'
- run: if [ ! -x "$(command -v yarn)" ]; then npm install -g yarn; fi
zemyblue marked this conversation as resolved.
Show resolved Hide resolved

- name: Install dependencies
run: |
yarn cache clean --all
yarn install

- name: Build
run: yarn run build

- name: Check if tag and version match
run: |
if [ "$(git tag --points-at ${{ github.sha }})" == "v$(jq -r .version packages/finschia/package.json)" ]; then
echo "Tag and version match. Proceeding with publish."
else
echo "Tag and version do not match. Skipping publish."
exit 1
fi

- name: Publish to NPM
run: |
cd packages/finschia
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
18 changes: 13 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ and this project adheres to
## [Unreleased]

### Added
- [\#69](https://github.com/Finschia/finschia-js/pull/69) apply the changes of `x/token` and `x/collection` protos
- [\#71](https://github.com/Finschia/finschia-js/pull/71) @lbmjs/finschia: Add custom GetBlockWithTxs for lbm
- [\#77](https://github.com/Finschia/finschia-js/pull/77) @lbmjs/finschia: Enable amino sign store msgs in `wasm` and `wasmplus`
- [\#80](https://github.com/Finschia/finschia-js/pull/80) add MsgInstantiateContract2

- [\#69](https://github.com/Finschia/finschia-js/pull/69) apply the changes of
`x/token` and `x/collection` protos
- [\#71](https://github.com/Finschia/finschia-js/pull/71) @lbmjs/finschia: Add
custom GetBlockWithTxs for lbm
- [\#77](https://github.com/Finschia/finschia-js/pull/77) @lbmjs/finschia:
Enable amino sign store msgs in `wasm` and `wasmplus`
- [\#80](https://github.com/Finschia/finschia-js/pull/80) add
MsgInstantiateContract2
- [\#81](https://github.com/Finschia/finschia-js/pull/81) add git PR template
- [\#87](https://github.com/Finschia/finschia-js/pull/87) @lbmjs/finschia: add tests for grpc errors in collection, token
- [\#78](https://github.com/Finschia/finschia-js/pull/78) add auth publish ci on
new tag, release
- [\#87](https://github.com/Finschia/finschia-js/pull/87) @lbmjs/finschia: add
tests for grpc errors in collection, token
zemyblue marked this conversation as resolved.
Show resolved Hide resolved

### Changed

Expand Down