Skip to content

Release move-tool

Release move-tool #13

Workflow file for this run

name: Release move-tool
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version number for this release (e.g., v1.0.0)'
required: true
default: 'v1.0.0'
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
artifact_name: linux-amd64
- goos: linux
goarch: arm64
artifact_name: linux-arm64
- goos: windows
goarch: amd64
artifact_name: windows-amd64
- goos: windows
goarch: arm64
artifact_name: windows-arm64
- goos: darwin
goarch: amd64
artifact_name: macos-intel
- goos: darwin
goarch: arm64
artifact_name: macos-apple-silicon
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.22'
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
BINARY_NAME=move-tool
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
go build -v -o ${BINARY_NAME}
- name: Zip artifact
run: |
ZIP_NAME=move-tool-${{ matrix.artifact_name }}.zip
BINARY_NAME=move-tool
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
zip ${ZIP_NAME} ${BINARY_NAME}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: move-tool-${{ matrix.artifact_name }}
path: move-tool-${{ matrix.artifact_name }}.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts
- name: Prepare release files
run: |
mkdir release_files
find artifacts -type f -name "move-tool-*" -exec cp {} release_files/ \;
- name: Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.event.inputs.version || github.ref }}
files: release_files/*
tag_name: ${{ github.event.inputs.version || github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}