Share workflow version varible #2
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: Create GitHub Release | |
on: | |
push: | |
branches: | |
- master | |
- github-release | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract version from package.json | |
id: extract_version | |
run: | | |
VERSION=$(grep 'version"' package.json | cut -d '"' -f 4) | |
echo "::set-output name=version::$VERSION" | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: '${{ steps.extract_version.outputs.version }}', | |
sha: context.sha | |
}) | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm install | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
out/Kino.pub_${{ steps.extract_version.outputs.version }}.zip | |
- name: Publish Release URL | |
run: | | |
echo "Release URL: ${{ steps.create_release.outputs.upload_url }}" |