Delete .github/workflows/release.yml

This commit is contained in:
gigirassy
2025-11-09 06:17:19 +01:00
parent 09f655f36d
commit 6ae9977d5d
-93
View File
@@ -1,93 +0,0 @@
name: Build & Release Go Binary
on:
push:
branches:
- main
permissions:
contents: write
packages: write
jobs:
prepare_release:
name: Prepare release (create tag + release)
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set_tag.outputs.TAG }}
steps:
- name: Checkout (full history required for tagging)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set TAG
id: set_tag
run: |
TAG="v$(date +'%Y%m%d%H%M%S')"
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Configure git user
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create and push tag
run: |
git tag ${{ steps.set_tag.outputs.TAG }}
git push origin ${{ steps.set_tag.outputs.TAG }}
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.set_tag.outputs.TAG }}
name: ${{ steps.set_tag.outputs.TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build_and_upload:
name: Build and upload artifacts
needs: prepare_release
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goos: darwin
goarch: '386'
- goos: windows
goarch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.24.8'
- name: Build binary
run: |
set -e
EXT=""
if [ "${{ matrix.goos }}" = "windows" ]; then EXT=".exe"; fi
OUT_DIR=build-artifacts
mkdir -p ${OUT_DIR}
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
go build -o ${OUT_DIR}/pinata-${{ matrix.goos }}-${{ matrix.goarch }}${EXT} ./
- name: Package artifact (tar/gzip)
if: matrix.goos == 'linux'
run: |
cd build-artifacts
tar -czf ../pinata-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz pinata-${{ matrix.goos }}-${{ matrix.goarch }}
ls -lh ..
- name: Upload artifact to the Release
# softprops/action-gh-release will find the release by tag and upload files
uses: softprops/action-gh-release@v1
with:
files: |
build-artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}