Skip to content

Commit

Permalink
Update pump-version.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowkora authored Nov 16, 2023
1 parent f5f399e commit 9fdc2c2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/pump-version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bump version on Merge
name: Bump Version on Merge

on:
push:
Expand All @@ -10,23 +10,31 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout Code
uses: actions/checkout@v4

- name: Calculate next version
- 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
- 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 "[email protected]"
- name: Bump version and publish
- name: Bump Version and Publish
run: |
./scripts/pump-version.sh ${{ env.NEXT_VERSION }}
env:
Expand Down

0 comments on commit 9fdc2c2

Please sign in to comment.