46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
name: Publish Go Releases
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
check-latest: true
|
|
go-version: '1.19'
|
|
|
|
- name: Cache go module
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Build
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: make releases
|
|
|
|
- name: Upload Releases
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
body: _Auto Released by Actions_
|
|
files: build/*
|
|
draft: false
|
|
prerelease: false
|
|
repository: javtube/metatube-server-releases
|
|
token: ${{ secrets.BOT_PAT }}
|