Release #56
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Version Tag (vX.X.X)" | |
type: string | |
required: true | |
prerelease: | |
type: boolean | |
required: false | |
default: yes | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.0-beta1 | |
stable: false | |
- name: Go Test | |
run: go test | |
- name: Install dependencies on Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y musl-tools libx11-dev | |
- name: Install dependencies on macOS | |
if: matrix.os == 'macos-13' | |
run: | | |
brew install filosottile/musl-cross/musl-cross | |
brew install libx11 | |
ln -s /opt/X11/include/X11 /usr/local/include/X11 | |
- name: Install dependencies on Windows | |
if: matrix.os == 'windows-latest' | |
run: choco install make | |
- name: Build | |
run: | | |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then | |
make linux | |
elif [ "${{ matrix.os }}" == "windows-latest" ]; then | |
make windows | |
elif [ "${{ matrix.os }}" == "macos-13" ]; then | |
make macos | |
fi | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-${{ matrix.os }} | |
path: dist/ | |
tag_and_release: | |
needs: build | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Download build artifacts from Linux | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-ubuntu-latest | |
path: dist/linux | |
- name: Download build artifacts from Windows | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-windows-latest | |
path: dist/windows | |
- name: Download build artifacts from macOS | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-macos-13 | |
path: dist/macos | |
- name: Create Tag | |
uses: negz/create-tag@v1 | |
with: | |
version: ${{ github.event.inputs.tag }} | |
message: "create tag" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create changelog text | |
id: changelog | |
uses: loopwerk/tag-changelog@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print changelog | |
run: | | |
cat <<EOF | |
${{ steps.changelog.outputs.changes }} | |
EOF | |
- name: Release & Assets | |
uses: Hs1r1us/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.tag }} | |
release_name: Upgit ${{ github.event.inputs.tag }} | |
body: ${{ steps.changelog.outputs.changes }} | |
asset_files: | | |
dist/linux/* | |
dist/windows/* | |
dist/macos/* | |
draft: false | |
prerelease: ${{ github.event.inputs.prerelease }} |