Skip to content

Update gh actions

Update gh actions #45

Workflow file for this run

name: Release
on:
push:
tags: ["v**"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ">=1.18"
- name: Build
run: make build-release
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: "server-tool.windows.exe"
path: "./build/server-tool.windows.exe"
- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: "server-tool.linux"
path: "./build/server-tool.linux"
release:
name: Create GitHub Release
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Get short tag name
uses: winterjung/split@v2
id: split
with:
msg: ${{ github.ref }}
separator: /
- name: Create Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.split.outputs._2 }}
name: ${{ steps.split.outputs._2 }}
commitish: ${{ github.sha }}
draft: false
prerelease: false
publish-win:
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get short tag name
uses: jungwinter/split@v1
id: split
with:
msg: ${{ github.ref }}
separator: /
- name: Fetch artifacts
uses: actions/download-artifact@v4
with:
name: server-tool.windows.exe
path: server-tool.windows.exe
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: server-tool.windows.exe/server-tool.windows.exe
publish-linux:
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get short tag name
uses: jungwinter/split@v1
id: split
with:
msg: ${{ github.ref }}
separator: /
- name: Fetch artifacts
uses: actions/download-artifact@v4
with:
name: server-tool.linux
path: server-tool.linux
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: server-tool.linux/server-tool.linux