mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
119 lines
3.0 KiB
YAML
119 lines
3.0 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*', 'test*']
|
|
|
|
jobs:
|
|
build_macos:
|
|
name: Build for MacOS
|
|
runs-on: macos-13
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: "Setup Go"
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '^1.17'
|
|
- name: Cache Go Modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: "Build"
|
|
run: make build_macos
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos
|
|
path: _output/macos/yarr.app
|
|
|
|
build_windows:
|
|
name: Build for Windows
|
|
runs-on: windows-2022
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: "Setup Go"
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '^1.17'
|
|
- name: Cache Go Modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: "Build"
|
|
run: make build_windows
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows
|
|
path: _output/windows/yarr.exe
|
|
|
|
build_linux:
|
|
name: Build for Linux
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
- name: "Setup Go"
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '^1.17'
|
|
- name: Cache Go Modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: "Build"
|
|
run: make build_linux
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux
|
|
path: _output/linux/yarr
|
|
|
|
create_release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
if: ${{ !contains(github.ref, 'test') }}
|
|
needs: [build_macos, build_windows, build_linux]
|
|
steps:
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v4.1.7
|
|
with:
|
|
path: .
|
|
- name: Preparation
|
|
run: |
|
|
ls -R
|
|
chmod u+x macos/Contents/MacOS/yarr
|
|
chmod u+x linux/yarr
|
|
|
|
mv macos yarr.app && zip -r yarr-${GITHUB_REF_NAME}-macos64.zip yarr.app
|
|
( cd windows && zip ../yarr-${GITHUB_REF_NAME}-windows64.zip yarr.exe )
|
|
( cd linux && zip ../yarr-${GITHUB_REF_NAME}-linux64.zip yarr )
|
|
- name: Upload Release
|
|
uses: softprops/action-gh-release@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
draft: true
|
|
prerelease: true
|
|
files: |
|
|
yarr-${{ github.ref_name }}-macos64.zip
|
|
yarr-${{ github.ref_name }}-windows64.zip
|
|
yarr-${{ github.ref_name }}-linux64.zip
|