Skip to content

Add nix support in go code #41

Add nix support in go code

Add nix support in go code #41

Workflow file for this run

name: Release
on:
push:
tags: ["v**"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ">=1.18"
- name: Build
run: make build-release
- name: Upload Windows build
uses: actions/upload-artifact@v3
with:
name: "server-tool.windows.exe"
path: "./build/server-tool.windows.exe"
- name: Upload Linux build
uses: actions/upload-artifact@v3
with:
name: "server-tool.linux"
path: "./build/server-tool.linux"
release:
name: Create Github Release
needs: [build]
runs-on: ubuntu-20.04
steps:
- name: Get short tag name
uses: jungwinter/split@v1
id: split
with:
msg: ${{ github.ref }}
seperator: /
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.split.outputs._2 }}
name: ${{ steps.split.outputs._2 }}
commit: ${{ github.sha }}
draft: false
prerelease: false
publish-win:
needs: [release]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get short tag name
uses: jungwinter/split@v1
id: split
with:
msg: ${{ github.ref }}
seperator: /
- name: Fetch artifacts
uses: actions/download-artifact@v3
with:
name: server-tool.windows.exe
path: server-tool.windows.exe
- name: Get release
id: get_release_info
uses: leahlundqvist/get-release@v1.3.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.split.outputs._2 }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: server-tool.windows.exe/server-tool.windows.exe
asset_name: server-tool.windows.exe
asset_content_type: application/octet-stream
publish-linux:
needs: [release]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get short tag name
uses: jungwinter/split@v1
id: split
with:
msg: ${{ github.ref }}
seperator: /
- name: Fetch artifacts
uses: actions/download-artifact@v3
with:
name: server-tool.linux
path: server-tool.linux
- name: Get release
id: get_release_info
uses: leahlundqvist/get-release@v1.3.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.split.outputs._2 }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: server-tool.linux/server-tool.linux
asset_name: server-tool.linux
asset_content_type: application/octet-stream