Skip to content

Commit

Permalink
Merge pull request #19 from nicarl/chore/revert-release-action
Browse files Browse the repository at this point in the history
Chore/revert release action
  • Loading branch information
nicarl committed Nov 25, 2022
2 parents 7588333 + 4a5b8b1 commit f7fb9a6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 114 deletions.
121 changes: 49 additions & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,69 @@ name: Release
on:
push:
tags:
- "*"

permissions:
contents: write
- "v*.*.*"

jobs:
build-linux-binary:
runs-on: ubuntu-latest
release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
env: GOOS=linux GOARCH=amd64
file: somafm-${{ github.ref_name }}-linux-amd64
- os: macos-latest
file: somafm-${{ github.ref_name }}-darwin-amd64
env: GOOS=darwin GOARCH=amd64
- os: windows-latest
file: somafm-${{ github.ref_name }}-windows-amd64.exe
env: ""

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
check-latest: true
cache: true

- name: Install dependencies
run: sudo apt-get install libasound2-dev
- name: Build
uses: goreleaser/goreleaser-action@v2
with:
args: release --skip-publish --config .goreleaser-for-linux.yaml
env:
GITHUB-TOKEN: ${{ secrets.HOMEBREW_PUBLISH_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: somafm-linux
path: dist/somafm*

build-darwin-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
check-latest: true
cache: true
- name: Build
uses: goreleaser/goreleaser-action@v2
if: matrix.os == 'ubuntu-latest'
- name: Build binary
run: ${{ matrix.env }} go build -o ${{ matrix.file }} ./cmd/somafm.go
- name: Upload release asset
uses: softprops/action-gh-release@v1
with:
args: release --skip-publish --config .goreleaser-for-darwin.yaml
env:
GITHUB-TOKEN: ${{ secrets.HOMEBREW_PUBLISH_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: somafm-darwin
path: dist/somafm*
files: ${{ matrix.file }}

release:
needs: [build-linux-binary, build-darwin-binary]
homebrew-releaser:
runs-on: ubuntu-latest
name: homebrew-releaser
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Release to Homebrew tap
uses: Justintime50/homebrew-releaser@v1
with:
go-version: 1.19
check-latest: true
cache: true
- name: Make directories
run: |
mkdir -p ./somafm-build/linux
mkdir -p ./somafm-build/darwin
- name: Download linux binaries
uses: actions/download-artifact@v3
with:
name: somafm-linux
path: ./somafm-build/linux
- name: Download darwin binaries
uses: actions/download-artifact@v3
with:
name: somafm-darwin
path: ./somafm-build/darwin
- name: Merge checksum file
run: |
cd ./somafm-build
cat ./darwin/somafm*checksums.txt >> checksums.txt
cat ./linux/somafm*checksums.txt >> checksums.txt
rm ./darwin/somafm*checksums.txt
rm ./linux/somafm*checksums.txt
- name: Release
uses: goreleaser/goreleaser-action@v3
with:
args: release --config .goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_PUBLISH_TOKEN }}
homebrew_owner: nicarl
homebrew_tap: homebrew-somafm
formula_folder: formula
github_token: ${{ secrets.HOMEBREW_PUBLISH_TOKEN }}
commit_owner: nicarl
commit_email: [email protected]

depends_on: |
"go" => :build
install: 'cd "src/github.com/nicarl/somafm" do system "go", "build", "-o", bin/"somafm", "./cmd/somafm.go" end'
update_readme_table: true

# Skips committing the generated formula to a homebrew tap (useful for local testing).
# Default is shown - boolean.
skip_commit: true

# Logs debugging info to console.
# Default is shown - boolean.
debug: true
13 changes: 0 additions & 13 deletions .goreleaser-for-darwin.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .goreleaser-for-linux.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .goreleaser-release.yaml

This file was deleted.

0 comments on commit f7fb9a6

Please sign in to comment.