Skip to content

Release

Release #5

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- stable
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build for Multiple Platforms
run: |
mkdir -p releases
PLATFORMS=("windows/amd64" "linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64")
for platform in "${PLATFORMS[@]}"; do
OS=${platform%/*}
ARCH=${platform#*/}
output_name="releases/cp2p-${OS}-${ARCH}"
if [ $OS = "windows" ]; then
output_name="$output_name.exe"
fi
GOOS=$OS GOARCH=$ARCH go build -o "$output_name" ./cmd/cpp2py
done
- name: Generate Next Version
id: semver
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.semver.outputs.new_tag }}
name: Release ${{ steps.semver.outputs.new_tag }}
body: ${{ steps.semver.outputs.changelog }}
files: |
releases/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}