Skip to content

Commit

Permalink
chore: make version configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Oct 11, 2024
1 parent 052e86a commit edd3f22
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- master
workflow_dispatch:
inputs:
version:
description: New version to create
required: false
default: ""
channel:
description: "Release channel"
required: true
Expand All @@ -19,7 +23,7 @@ jobs:
semantic-release:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.semantic.outputs.new_release_version }}
release-version: ${{ inputs.version == "" && steps.semantic.outputs.new_release_version || inputs.version }}
new-release-published: ${{ steps.semantic.outputs.new-release-published }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
Expand All @@ -36,12 +40,24 @@ jobs:
fi
echo "BRANCHES=$BRANCHES" >> $GITHUB_ENV
- uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0
if: ${{ inputs.version == "" }}
id: semantic
with:
branches: ${{ env.BRANCHES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create tag
if: ${{ inputs.version != "" }}
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ inputs.version }}',
sha: context.sha
})
binary:
runs-on: ubuntu-latest
needs: semantic-release
Expand Down

0 comments on commit edd3f22

Please sign in to comment.