Add the CI github workflow
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
name: Create base release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
[main]
|
||||
types:
|
||||
[opened]
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
name: Create a new release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version_type: ${{ steps.bump_setup.outputs.type }}
|
||||
steps:
|
||||
- name: Setup bump release
|
||||
id: bump_setup
|
||||
run: |
|
||||
if [ ${{ contains(github.event.pull_request.labels.*.name, 'release:major') }} == true ]; then
|
||||
echo "::set-output name=type::major"
|
||||
elif [ ${{ contains(github.event.pull_request.labels.*.name, 'release:minor') }} == true ]; then
|
||||
echo "::set-output name=type::minor"
|
||||
else
|
||||
echo "::set-output name=type::patch"
|
||||
fi
|
||||
|
||||
- name: Setup a new Semantic Version
|
||||
id: semantic_setup
|
||||
uses: zwaldowski/semver-release-action@v2
|
||||
with:
|
||||
bump: ${{ steps.bump_setup.outputs.type }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
dry_run: true
|
||||
|
||||
- name: Prepare the release
|
||||
uses: ncipollo/release-action@v1.8.10
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
prerelease: true
|
||||
tag: 'v${{ steps.semantic_setup.outputs.version }}'
|
||||
Reference in New Issue
Block a user