Skip to content

Commit

Permalink
ci: NPM publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed Apr 23, 2022
1 parent a9399d0 commit 9d2c294
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/core.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Frontend core tests

on: [pull_request]
on:
pull_request:
workflow_call:
secrets:
GHCR_TOKEN:
required: true

jobs:
test:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: NPM publish

on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]

jobs:
test:
uses: ./.github/workflows/core.yml
secrets:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}

release:
needs: test
runs-on: ubuntu-latest
env:
IS_SNAPSHOT: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-node@v2
with:
node-version: "16.x"
cache: yarn

- run: yarn install --immutable

- if: ${{ fromJSON(env.IS_SNAPSHOT) }}
run: yarn workspaces foreach version 0.0.0-snapshot.$(git rev-parse --short HEAD)

- run: yarn build
- run: yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
- run: yarn workspaces foreach npm publish --tolerate-republish --access public ${{ fromJSON(env.IS_SNAPSHOT) && '--tag snapshot' || '' }}
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.2.0.cjs
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "e2e",
"version": "1.0.0",
"private": true,
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-class-properties": "^7.16.7",
Expand Down
2 changes: 1 addition & 1 deletion react-example/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "vite-react-ts-tailwind-starter",
"version": "0.0.1",
"private": true,
"license": "MIT",
"author": {
"name": "TeXmeijin"
},
"private": true,
"workspaces": {
"nohoist": [
"@types/react",
Expand Down
1 change: 1 addition & 0 deletions wallet-keplr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@sifchain/wallet-keplr",
"version": "1.0.0",
"private": true,
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
Expand Down
1 change: 1 addition & 0 deletions wallet-metamask/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@sifchain/wallet-metamask",
"version": "1.0.0",
"private": true,
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
Expand Down
1 change: 1 addition & 0 deletions wallet-terra-station/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@sifchain/wallet-terra-station",
"version": "1.0.0",
"private": true,
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
Expand Down

0 comments on commit 9d2c294

Please sign in to comment.