forked from near/wallet-selector
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.48 KB
/
bump-version.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
on:
push:
branches:
- main
workflow_dispatch:
permissions:
actions: write
issues: write
pull-requests: write
contents: write
jobs:
release:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Git
run: |
git config user.name "GitHub Bot"
git config user.email "gituser@example.com"
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ./.npmrc
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: 'yarn'
- name: Check example apps
run: echo "EXAMPLE_APPS=$(ls ./examples | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- name: Bump version
if: github.ref == 'refs/heads/main'
run: yarn nx run core:version --dryRun
- name: Bump version
if: github.ref != 'refs/heads/main'
run: yarn nx run core:version:dev --dryRun
- name: Tag version
if: github.ref == 'refs/heads/main'
run: echo "GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2> /dev/null)" >> $GITHUB_ENV
- name: Run Build All
run: yarn build:all
# Use npx instead of yarn because yarn automatically sets NPM_* environment variables
# like NPM_CONFIG_REGISTRY so npm publish ends up ignoring the .npmrc file
# which is set up by `setup-node` action.
- name: Deploy
run: npx nx run-many --target=deploy --all --noBuild --exclude=$EXAMPLE_APPS --dry-run
env:
EXAMPLE_APPS: ${{ env.EXAMPLE_APPS }}
# Drafts your next Release notes as Pull Requests are merged into "main"
- name: Draft Release notes
id: draft-release-notes
uses: release-drafter/release-drafter@v5
if: github.ref == 'refs/heads/main'
with:
config-name: release-drafter.yml
publish: true
tag: ${{ env.GIT_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
uses: ad-m/github-push-action@master
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
force: true
tags: true