Release commit workflow
This commit is contained in:
43
.github/workflows/release.yml
vendored
43
.github/workflows/release.yml
vendored
@@ -12,9 +12,9 @@ env:
|
||||
BINARY_NAME: streamed-tui
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -35,6 +35,7 @@ jobs:
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
# Build raw binary
|
||||
- name: Build binary
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
@@ -42,23 +43,25 @@ jobs:
|
||||
CGO_ENABLED: 0
|
||||
run: |
|
||||
mkdir -p dist
|
||||
outfile="${BINARY_NAME}_${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||
go build -o "dist/${outfile}" .
|
||||
out="streamed-tui_${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||
go build -o "dist/${out}" .
|
||||
|
||||
# Upload binary as an artifact
|
||||
- name: Upload binary artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bin_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
path: dist/${{ env.BINARY_NAME }}_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
path: dist/streamed-tui_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
|
||||
source:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Create source tarball
|
||||
- name: Make source tarball
|
||||
run: |
|
||||
mkdir -p dist
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
@@ -77,17 +80,37 @@ jobs:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download ALL artifacts to dist/
|
||||
# ❌ Delete all previous artifacts so old tar.gz does not pollute dist/
|
||||
- name: Delete old workflow artifacts
|
||||
uses: geekyeggo/delete-artifact@v4
|
||||
with:
|
||||
name: "*"
|
||||
|
||||
# Clean runner dist directory just in case
|
||||
- name: Prepare clean dist folder
|
||||
run: |
|
||||
rm -rf dist
|
||||
mkdir dist
|
||||
|
||||
# ⬇ Download only FRESH artifacts
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
|
||||
- name: Force-create GitHub Release
|
||||
# 🟢 Upload to GitHub Release
|
||||
- name: Publish Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
tag_name: ${{ github.ref_name }}
|
||||
files: dist/*
|
||||
|
||||
# Only publish what we want:
|
||||
files: |
|
||||
dist/streamed-tui_linux_amd64
|
||||
dist/streamed-tui_linux_arm64
|
||||
dist/streamed-tui_darwin_amd64
|
||||
dist/streamed-tui_darwin_arm64
|
||||
dist/streamed-tui_*_source.tar.gz
|
||||
|
||||
Reference in New Issue
Block a user