Skip to content

ci: add test and release workflows (#3) #1

ci: add test and release workflows (#3)

ci: add test and release workflows (#3) #1

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
ext=""
if [ "$GOOS" = "windows" ]; then ext=".exe"; fi
go build -trimpath -ldflags="-s -w" -o "gh-enterprise-contribution-sync-${GOOS}-${GOARCH}${ext}" .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: gh-enterprise-contribution-sync-${{ matrix.goos }}-${{ matrix.goarch }}
path: gh-enterprise-contribution-sync-*
publish:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --generate-notes gh-enterprise-contribution-sync-*