Skip to content

Commit

Permalink
Fallback to old release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mzfr committed Feb 25, 2023
1 parent 949a446 commit f43156c
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 25 deletions.
161 changes: 137 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,145 @@
name: goreleaser
name: build

on:
push:
tags:
- '*'

permissions:
contents: write
tags: ['v*', 'test*']

jobs:
goreleaser:
build_macos:
name: Build for MacOS
runs-on: macos-10.15
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "Setup Go"
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: Cache Go Modules
uses: actions/cache@v2
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@v2
with:
name: macos
path: _output/macos/yarr.app

build_windows:
name: Build for Windows
runs-on: windows-2019
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "Setup Go"
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: Cache Go Modules
uses: actions/cache@v2
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@v2
with:
name: windows
path: _output/windows/yarr.exe

build_linux:
name: Build for Linux
runs-on: ubuntu-18.04
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "Setup Go"
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: Cache Go Modules
uses: actions/cache@v2
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@v2
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: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/[email protected]
with:
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: true
- name: Download Artifacts
uses: actions/download-artifact@v2
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-macos.zip yarr.app
mv windows/yarr.exe . && zip yarr-windows.zip yarr.exe
mv linux/yarr . && zip yarr-linux.zip yarr
- name: Upload MacOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yarr-macos.zip
asset_name: yarr-${{ github.ref }}-macos64.zip
asset_content_type: application/zip
- name: Upload Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yarr-windows.zip
asset_name: yarr-${{ github.ref }}-windows64.zip
asset_content_type: application/zip
- name: Upload Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yarr-linux.zip
asset_name: yarr-${{ github.ref }}-linux64.zip
asset_content_type: application/zip

2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=2.3
VERSION=1.0
GITHASH=$(shell git rev-parse --short=8 HEAD)

CGO_ENABLED=1
Expand Down

0 comments on commit f43156c

Please sign in to comment.