2023-02-24 18:56:49 +01:00
|
|
|
name: Server Releaser
|
2023-02-24 18:51:16 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "*"
|
|
|
|
|
2023-02-25 03:59:11 +01:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2023-02-24 18:51:16 +01:00
|
|
|
jobs:
|
|
|
|
releases-matrix:
|
|
|
|
name: Release Go Binary
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
goos: [linux, darwin]
|
|
|
|
goarch: [amd64, arm, arm64]
|
2023-02-24 18:55:51 +01:00
|
|
|
exclude:
|
|
|
|
- goos: darwin
|
|
|
|
goarch: arm
|
2023-02-24 18:51:16 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Go
|
2023-02-24 18:53:04 +01:00
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.18
|
2023-02-24 18:51:16 +01:00
|
|
|
- name: Build server binary
|
|
|
|
run: |
|
|
|
|
GOARCH=${{ matrix.goarch }} GOOS=${{ matrix.goos }} go build -o hishtory-server-${{ matrix.goos }}-${{ matrix.goarch }} backend/server/server.go
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
2023-02-25 03:53:20 +01:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
2023-02-24 18:51:16 +01:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
hishtory-server-${{ matrix.goos }}-${{ matrix.goarch }}
|