Skip to content

Upload Release Asset #3

Upload Release Asset

Upload Release Asset #3

Workflow file for this run

---
name: Upload Release Asset
on:
workflow_dispatch:
release:
types: [published]
jobs:
codecov:
runs-on: ubuntu-latest
name: Codecov
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go test"
run: |
go test -v -failfast -timeout=300s -count=2 -coverprofile=coverage.txt ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
upload_linux:
name: "Linux Binaries"
needs: codecov
strategy:
matrix:
os: [linux]
arch: [amd64,arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go build"
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build ./cmd/sbsmux
tar cJvf ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.tar.xz ./sbsmux
rm -v ./sbsmux
- name: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.tar.xz
upload_windows:
name: "Windows Binaries"
needs: codecov
strategy:
matrix:
os: [windows]
arch: [amd64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go build"
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build ./cmd/sbsmux
zip -vD ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.zip ./sbsmux
rm -v ./sbsmux
- name: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.zip