diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0f7aed..e7ad4dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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