From a0ee2db58f948621c1c9a16dadc15b01dad020b5 Mon Sep 17 00:00:00 2001 From: Bryan Bailey Date: Fri, 6 Mar 2026 22:42:20 -0500 Subject: [PATCH] ci(yoink): rewrite release workflow using Makefile and softprops/action-gh-release --- .github/workflows/release.yaml | 185 +++------------------------------ 1 file changed, 16 insertions(+), 169 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4dfe925..6330f50 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Build and Release +name: Release on: push: @@ -6,185 +6,32 @@ on: - 'v*' jobs: - build-and-release-linux: - name: Build and Release for Linux + release: + name: Build and Release runs-on: [self-hosted, linux, arm64] steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: '1.22.3' - - name: Build for Linux - run: go build -o myapp + - name: Build + run: make all - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.ref_name }} - release_name: Release ${{ github.ref_name }} - body: Release notes for ${{ github.ref_name }} - draft: false - prerelease: false - - - name: Save upload_url - run: echo "UPLOAD_URL=${{ steps.create_release.outputs.upload_url }}" > upload_url.txt - shell: bash - - - name: Upload upload_url artifact - uses: actions/upload-artifact@v3 - with: - name: upload_url - path: upload_url.txt - - build-and-release-windows: - name: Build and Release for Windows - runs-on: windows-latest - needs: build-and-release-linux - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.22.3' - - - name: Build for Windows - run: go build -o myapp.exe - - - name: Download upload_url artifact - uses: actions/download-artifact@v3 - with: - name: upload_url - path: . - - - name: Read upload_url - id: read_upload_url - run: | - UPLOAD_URL=$(cat upload_url.txt) - echo "::set-output name=upload_url::$UPLOAD_URL" - shell: bash - - - name: Debug upload_url - run: | - echo "Upload URL: ${{ steps.read_upload_url.outputs.upload_url }}" - - - name: Upload Windows Release Asset - if: startsWith(github.ref, 'refs/tags/') - uses: actions/upload-release-asset@v1 + name: ${{ github.ref_name }} + files: build/* + generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.read_upload_url.outputs.upload_url }} - asset_path: ./myapp.exe - asset_name: myapp-windows.exe - asset_content_type: application/octet-stream - -# name: Yoink Release - -# on: -# push: -# tags: -# - 'v*' - -# jobs: -# yoink-release: -# name: Yoink Build and Release -# runs-on: [self-hosted, linux, arm64] - -# steps: -# - name: Checkout -# uses: actions/checkout@v3 - -# - name: Setup Go -# uses: actions/setup-go@v4 -# with: -# go-version: '1.22.3' - -# - name: Linux Build -# run: go build -o yoink - -# - name: Create Release -# id: create_release -# uses: actions/create-release@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# tag_name: ${{ github.ref_name }} -# release_name: Release ${{ github.ref_name }} -# body: Release notes for ${{ github.ref_name }} -# draft: false -# prerelease: false - -# - name: Save upload_url -# run: echo "UPLOAD_URL=${{ steps.create_release.outputs.upload_url }}" > upload_url.txt -# shell: bash - -# - name: Upload upload_url artifact -# uses: actions/upload-artifact@v3 -# with: -# name: upload_url.txt -# path: ./upload_url.txt - -# - name: Upload Linux Release Asset -# uses: actions/upload-release-asset@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# upload_url: ${{ steps.create_release.outputs.upload_url }} -# asset_path: ./yoink -# asset_name: yoink -# asset_content_type: application/x-executable - -# build-and-release-win: -# runs-on: windows-latest -# needs: yoink-release - -# steps: -# - name: Checkout -# uses: actions/checkout@v3 - -# - name: Setup Go -# uses: actions/setup-go@v4 -# with: -# go-version: '1.22.3' - -# - name: Windows Build -# run: go build -o yoink.exe - -# - name: Download upload_url artifact -# uses: actions/download-artifact@v3 -# with: -# name: upload_url.txt -# path: . - -# - name: Read upload_url artifact -# id: read_upload_url -# run: | -# UPLOAD_URL=$(cat upload_url.txt) -# echo "::set-output name=upload_url::$UPLOAD_URL" -# shell: bash - -# - name: Debug upload_url -# run: echo ${{ steps.read_upload_url.outputs.upload_url }} -# shell: bash - -# - name: Upload Windows Release Asset -# uses: actions/upload-release-asset@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# upload_url: ${{ steps.read_upload_url.outputs.upload_url }} -# asset_path: ./yoink.exe -# asset_name: yoink.exe -# asset_content_type: application/x-executable \ No newline at end of file + - name: Clean up + if: always() + run: make clean