From 57f49e16f8e50137a8442fbfe4dca20e7c2023cb Mon Sep 17 00:00:00 2001 From: Bryan Bailey Date: Fri, 30 Aug 2024 23:11:47 -0400 Subject: [PATCH] build(yoink): configuring release --- .github/workflows/release.yaml | 52 +++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d669b2d..f0c8ca6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,8 +7,9 @@ on: jobs: yoink-release: - name: Release - runs-on: ARM64 + name: Yoink Build and Release + runs-on: [self-hosted, linux, arm64] + steps: - name: Checkout uses: actions/checkout@v3 @@ -18,7 +19,7 @@ jobs: with: go-version: '1.22.3' - - name: Build + - name: Linux Build run: go build -o yoink - name: Create Release @@ -33,7 +34,11 @@ jobs: draft: false prerelease: false - - name: Upload Release Asset + - name: Save upload_url + run: echo "UPLOAD_URL=${{ steps.create_release.outputs.upload_url }}" > upload_url.txt + shell: bash + + - name: Upload Linux Release Asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -42,3 +47,42 @@ jobs: 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: 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