-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.24 KB
/
pump-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
name: Bump Version on Merge
on:
push:
branches:
- csl-action-pump-ver # TODO: reverse
jobs:
bump_version:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Calculate Next Version
run: |
# Get the current version from the subdirectory's package.json
current_version=$(jq -r '.version' package.json)
# Calculate and append the next version directly into GITHUB_ENV in one line
echo "NEXT_VERSION=$(echo "$current_version" | awk -F'[-.]' '{print $1"."$2"."$3"-minswap."$5+1}')" >> "$GITHUB_ENV"
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install Dependencies
run: |
npm install --ignore-scripts
npm install -g wasm-pack
- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@users.noreply.github.com"
- name: Bump Version and Publish
run: |
./scripts/pump-version.sh ${{ env.NEXT_VERSION }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}