feat: add github workflow for build and release
Some checks failed
container-images / build-container-image (push) Has been cancelled
Some checks failed
container-images / build-container-image (push) Has been cancelled
This commit is contained in:
35
.github/workflows/release.yml
vendored
Normal file
35
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check if stable release
|
||||
id: check
|
||||
run: |
|
||||
# align with build-docker.yml: stable only for strict semver tags
|
||||
if [[ "${{ github.ref_name }}" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
|
||||
echo "stable=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "stable=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
generate_release_notes: true
|
||||
draft: false
|
||||
prerelease: ${{ steps.check.outputs.stable != 'true' }}
|
||||
make_latest: ${{ steps.check.outputs.stable == 'true' }}
|
||||
Reference in New Issue
Block a user