Enhance CI workflow for versioning and release handling
Updated CI workflow to include versioning and handle releases for both tags and the dev branch.
This commit is contained in:
@@ -47,6 +47,8 @@ jobs:
|
|||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
VERSION: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.sha }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.goarch }}" = "amd64" ]; then
|
if [ "${{ matrix.goarch }}" = "amd64" ]; then
|
||||||
make build-linux
|
make build-linux
|
||||||
@@ -92,25 +94,27 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
ghcr.io/cedar2025/xboard-node:latest
|
ghcr.io/cedar2025/xboard-node:latest
|
||||||
ghcr.io/cedar2025/xboard-node:${{ github.sha }}
|
ghcr.io/cedar2025/xboard-node:${{ github.sha }}
|
||||||
|
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/cedar2025/xboard-node:{0}', github.ref_name) || '' }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/dev'
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
path: dist
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'dev' }}
|
||||||
|
make_latest: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
files: |
|
files: |
|
||||||
xboard-node-linux-amd64
|
dist/xboard-node-linux-amd64
|
||||||
xboard-node-linux-arm64
|
dist/xboard-node-linux-arm64
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user