build(yoink): configuring release
This commit is contained in:
160
.github/workflows/release.yaml
vendored
160
.github/workflows/release.yaml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Yoink Release
|
name: Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -6,21 +6,21 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yoink-release:
|
build-and-release-linux:
|
||||||
name: Yoink Build and Release
|
name: Build and Release for Linux
|
||||||
runs-on: [self-hosted, linux, arm64]
|
runs-on: [self-hosted, linux, arm64]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '1.22.3'
|
go-version: '1.22.3'
|
||||||
|
|
||||||
- name: Linux Build
|
- name: Build for Linux
|
||||||
run: go build -o yoink
|
run: go build -o myapp
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
@@ -41,42 +41,33 @@ jobs:
|
|||||||
- name: Upload upload_url artifact
|
- name: Upload upload_url artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: upload_url.txt
|
name: upload_url
|
||||||
path: ./upload_url.txt
|
path: upload_url.txt
|
||||||
|
|
||||||
- name: Upload Linux Release Asset
|
build-and-release-windows:
|
||||||
uses: actions/upload-release-asset@v1
|
name: Build and Release for Windows
|
||||||
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
|
runs-on: windows-latest
|
||||||
needs: yoink-release
|
needs: build-and-release-linux
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '1.22.3'
|
go-version: '1.22.3'
|
||||||
|
|
||||||
- name: Windows Build
|
- name: Build for Windows
|
||||||
run: go build -o yoink.exe
|
run: go build -o myapp.exe
|
||||||
|
|
||||||
- name: Download upload_url artifact
|
- name: Download upload_url artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: upload_url.txt
|
name: upload_url
|
||||||
path: .
|
path: .
|
||||||
|
|
||||||
- name: Read upload_url artifact
|
- name: Read upload_url
|
||||||
id: read_upload_url
|
id: read_upload_url
|
||||||
run: |
|
run: |
|
||||||
UPLOAD_URL=$(cat upload_url.txt)
|
UPLOAD_URL=$(cat upload_url.txt)
|
||||||
@@ -84,15 +75,116 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Debug upload_url
|
- name: Debug upload_url
|
||||||
run: echo ${{ steps.read_upload_url.outputs.upload_url }}
|
run: |
|
||||||
shell: bash
|
echo "Upload URL: ${{ steps.read_upload_url.outputs.upload_url }}"
|
||||||
|
|
||||||
- name: Upload Windows Release Asset
|
- name: Upload Windows Release Asset
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.read_upload_url.outputs.upload_url }}
|
upload_url: ${{ steps.read_upload_url.outputs.upload_url }}
|
||||||
asset_path: ./yoink.exe
|
asset_path: ./myapp.exe
|
||||||
asset_name: yoink.exe
|
asset_name: myapp-windows.exe
|
||||||
asset_content_type: application/x-executable
|
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
|
||||||
Reference in New Issue
Block a user