Add github ci actions to build binaries and docker image #11
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
on: | |
push: | |
tags: | |
- 'v*' | |
name: Build Binary Release | |
jobs: | |
build: | |
name: build binary for ${{ matrix.os }}/${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
arch: [ "amd64", "arm64" ] | |
os: [ "linux", "darwin" ] | |
steps: | |
- uses: actions/checkout@master | |
with: | |
ref: ${{ github.ref }} | |
- name: compile and release | |
run: | | |
mkdir -p target/podcast-sync-server-${{ matrix.os }}-${{ matrix.arch }} | |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o target/podcast-sync-server-${{ matrix.os }}-${{ matrix.arch }}/ | |
cp LICENSE target/podcast-sync-server-${{ matrix.os }}-${{ matrix.arch }}/ | |
tar -czf target/podcast-sync-server-${{ matrix.os }}-${{ matrix.arch }}.tar.gz target/podcast-sync-server-${{ matrix.os }}-${{ matrix.arch }}/ | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/podcast-sync-server-${{ matrix.os }}-${{ matrix.arch }}.tar.gz | |
overwrite: true | |
body: "Release ${{ env.GITHUB_REF }}" |