Skip to content

Commit

Permalink
Add release branch GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
eharris128 committed Dec 3, 2024
1 parent d1f2f7f commit 4d3448b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create Release

on:
push:
branches:
- 'release/[0-9]+.[0-9]+.[0-9]+'

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Extract version from branch name
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/heads/release/}" >> $GITHUB_OUTPUT

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Build plugin
run: |
npm install
npm run build
- name: Create Tag
run: |
git config user.name github-actions
git config user.email [email protected]
git tag ${{ steps.extract_version.outputs.VERSION }}
git push origin ${{ steps.extract_version.outputs.VERSION }}
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.extract_version.outputs.VERSION }} \
--title="${{ steps.extract_version.outputs.VERSION }}" \
--generate-notes \
main.js manifest.json styles.css

0 comments on commit 4d3448b

Please sign in to comment.