forked from openwallet-foundation/bifold-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (52 loc) · 1.87 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Publish
on:
push:
branches:
- main
paths:
- 'packages/**'
workflow_dispatch:
env:
NPM_PKG: '@hyperledger/aries-oca'
NPM_TAG: 'alpha'
jobs:
release-canary:
name: Alpha Release
runs-on: ubuntu-22.04
timeout-minutes: 7
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup NodeJS
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --immutable
# On push to main, release unstable version
- name: Release ${{ env.NPM_TAG }}
run: |
git update-index --assume-unchanged $(find . -type d -name node_modules -prune -o -name 'package.json' -print | tr "\n" " ")
#export NEXT_VERSION_BUMP=$(yarn next-version-bump)
export NEXT_VERSION_BUMP="major"
npx lerna publish --no-private --loglevel=silly --canary $NEXT_VERSION_BUMP --dist-tag $NPM_TAG --force-publish --yes
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }}
- name: Fetch current published version
id: get-version
run: |
LAST_RELEASED_VERSION=$(npm view $NPM_PKG@$NPM_TAG version)
echo "last_released_version=$LAST_RELEASED_VERSION" >> $GITHUB_OUTPUT
- name: Config git
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
- name: Set current git tag
run: |
git tag v${{ steps.get-version.outputs.last_released_version }}
git push origin v${{ steps.get-version.outputs.last_released_version}} --no-verify
# Release will be triggerd by
# if: "${{ startsWith(github.event.head_commit.message, 'chore(release): v') }}"