v0.1.4 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Set Package Version | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
set-package-version: | |
name: Set Package Version | |
runs-on: ubuntu-latest | |
env: | |
HUSKY: 0 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
- name: Set branch to main | |
run: git branch -f main && git checkout main | |
- name: Determine branch | |
run: | |
echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV | |
- name: Set Package Version | |
run: | | |
TAG_NAME="${{ github.event.release.tag_name }}" | |
VERSION=${TAG_NAME#v} | |
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" "package.json" | |
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" "deno.jsonc" | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add package.json | |
git add deno.jsonc | |
git commit --no-verify -m "Bump version to $VERSION" | |
git push origin HEAD:$BRANCH_NAME |