Skip to content

Commit

Permalink
Use publish workflow from k8x
Browse files Browse the repository at this point in the history
  • Loading branch information
nhh authored Nov 21, 2024
1 parent c57e949 commit cdea357
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Build and release binaries

on:
push:
tags:
- "v*.*.*-alpha"

jobs:
build-linux:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build -o nfs-linux-x86_64 .
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: nfs-linux-x86_64
path: ./nfs-linux-x86_64
build-macos:
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build -o nfs-darwin-x86_64 .
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: nfs-darwin-x86_64
path: ./nfs-darwin-x86_64
build-windows:
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build -o nfs-windows-x86_64.exe .
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: nfs-windows-x86_64.exe
path: ./nfs-windows-x86_64.exe
release:
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
needs:
- build-windows
- build-linux
- build-macos
runs-on: ubuntu-latest
steps:
# Downloads all artifacts:
- name: Download a single artifact
uses: actions/download-artifact@v4
- name: Create github release
uses: ncipollo/release-action@v1
with:
artifacts: "./*/nfs-*"

0 comments on commit cdea357

Please sign in to comment.