Release pipeline
This commit is contained in:
parent
3d77945981
commit
a5c7a5fea7
3 changed files with 55 additions and 1 deletions
47
.gitea/workflows/build.yml
Normal file
47
.gitea/workflows/build.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
|
||||||
|
name: Build and release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
# workflow_dispatch:
|
||||||
|
# inputs:
|
||||||
|
# version:
|
||||||
|
# description: 'Version'
|
||||||
|
# required: true
|
||||||
|
# default: 'v0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: [moon, amd64]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.23'
|
||||||
|
|
||||||
|
# - name: Install dependencies
|
||||||
|
# run: |
|
||||||
|
# sudo apt-get update
|
||||||
|
# sudo apt-get install -y task
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: task test
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
task build VERSION=${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: ./lobby2-${{ github.ref_name }}-amd64
|
||||||
|
asset_name: lobby2-${{ github.ref_name }}-amd64
|
||||||
|
asset_content_type: application/octet-stream
|
|
@ -1,4 +1,4 @@
|
||||||
name: Test Project
|
name: Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
|
vars:
|
||||||
|
VERSION: 0.0.0
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
docs:
|
docs:
|
||||||
cmds:
|
cmds:
|
||||||
|
@ -12,3 +15,7 @@ tasks:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
- go test -v ./...
|
- go test -v ./...
|
||||||
silent: false
|
silent: false
|
||||||
|
build:
|
||||||
|
cmds:
|
||||||
|
- go mod tidy
|
||||||
|
- go build -o lobby2-{{ .VERSION }}-amd64 cli/*.go
|
||||||
|
|
Loading…
Reference in a new issue