mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2026-02-11 08:49:21 +00:00
ci: update release
This commit is contained in:
parent
9c93fcdb24
commit
3ecc85f8d2
2 changed files with 37 additions and 1 deletions
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
|
|
@ -54,6 +54,41 @@ jobs:
|
|||
env:
|
||||
DEBUG_OUTPUT: ${{ steps.run.outputs.debug_output }}
|
||||
|
||||
create-tag:
|
||||
name: Create Version Tag
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: blob:none
|
||||
|
||||
- name: Get version
|
||||
uses: ./
|
||||
id: version
|
||||
|
||||
- name: Check if tag exists
|
||||
id: check
|
||||
run: |
|
||||
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
|
||||
echo "exists=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "exists=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create and push tag
|
||||
if: steps.check.outputs.exists == 'false'
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
|
||||
git push origin "v${{ steps.version.outputs.version }}"
|
||||
|
||||
release:
|
||||
name: Publish Release
|
||||
needs: build
|
||||
|
|
|
|||
|
|
@ -182,7 +182,8 @@ zero to pull the full history and tags.
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-depth: 0 # fetch all history
|
||||
filter: blob:none # exclude file contents for faster checkout
|
||||
```
|
||||
|
||||
Alternatively, you can set this number to a value high enough to pull all the commits
|
||||
|
|
|
|||
Loading…
Reference in a new issue