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
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.sha }}
|
||||
run: |
|
||||
if [ "${{ matrix.goarch }}" = "amd64" ]; then
|
||||
make build-linux
|
||||
@@ -92,25 +94,27 @@ jobs:
|
||||
tags: |
|
||||
ghcr.io/cedar2025/xboard-node:latest
|
||||
ghcr.io/cedar2025/xboard-node:${{ github.sha }}
|
||||
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/cedar2025/xboard-node:{0}', github.ref_name) || '' }}
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/dev'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
merge-multiple: true
|
||||
path: dist
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'dev' }}
|
||||
make_latest: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
files: |
|
||||
xboard-node-linux-amd64
|
||||
xboard-node-linux-arm64
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
dist/xboard-node-linux-amd64
|
||||
dist/xboard-node-linux-arm64
|
||||
|
||||
Reference in New Issue
Block a user