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
|
BINARY_NAME: streamed-tui
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -35,6 +35,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
|
# Build raw binary
|
||||||
- name: Build binary
|
- name: Build binary
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
@@ -42,23 +43,25 @@ jobs:
|
|||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
outfile="${BINARY_NAME}_${{ matrix.goos }}_${{ matrix.goarch }}"
|
out="streamed-tui_${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||||
go build -o "dist/${outfile}" .
|
go build -o "dist/${out}" .
|
||||||
|
|
||||||
|
# Upload binary as an artifact
|
||||||
- name: Upload binary artifact
|
- name: Upload binary artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: bin_${{ matrix.goos }}_${{ matrix.goarch }}
|
name: bin_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||||
path: dist/${{ env.BINARY_NAME }}_${{ matrix.goos }}_${{ matrix.goarch }}
|
path: dist/streamed-tui_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||||
|
|
||||||
source:
|
source:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Create source tarball
|
- name: Make source tarball
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
tag="${GITHUB_REF_NAME}"
|
tag="${GITHUB_REF_NAME}"
|
||||||
@@ -77,17 +80,37 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
steps:
|
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
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: dist
|
path: dist
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Force-create GitHub Release
|
# 🟢 Upload to GitHub Release
|
||||||
|
- name: Publish Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
generate_release_notes: true
|
|
||||||
tag_name: ${{ github.ref_name }}
|
# Only publish what we want:
|
||||||
files: dist/*
|
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