Compare commits
2 Commits
v1.1.0
...
5d7c324fb7
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d7c324fb7 | |||
| a0ee2db58f |
185
.github/workflows/release.yaml
vendored
185
.github/workflows/release.yaml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Build and Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -6,185 +6,32 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release-linux:
|
release:
|
||||||
name: Build and Release for Linux
|
name: Build and Release
|
||||||
runs-on: [self-hosted, linux, arm64]
|
runs-on: [self-hosted, linux, arm64]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.22.3'
|
go-version: '1.22.3'
|
||||||
|
|
||||||
- name: Build for Linux
|
- name: Build
|
||||||
run: go build -o myapp
|
run: make all
|
||||||
|
|
||||||
- name: Create Release
|
- name: Release
|
||||||
id: create_release
|
uses: softprops/action-gh-release@v2
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ github.ref_name }}
|
||||||
release_name: Release ${{ github.ref_name }}
|
name: ${{ github.ref_name }}
|
||||||
body: Release notes for ${{ github.ref_name }}
|
files: build/*
|
||||||
draft: false
|
generate_release_notes: true
|
||||||
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
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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: Clean up
|
||||||
# name: Yoink Release
|
if: always()
|
||||||
|
run: make clean
|
||||||
# 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
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Build from source (requires Go 1.22.3+):
|
|||||||
go build -o yoink
|
go build -o yoink
|
||||||
```
|
```
|
||||||
|
|
||||||
Pre-built binaries for Linux (arm64) and Windows are available on the [releases page](../../releases).
|
Pre-built binaries for Linux (arm64) and Windows are available on the [releases page](https://git.brizzle.dev/bryan/yoink-go/releases).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user