Skip to content

Manual Release Creator #31

Manual Release Creator

Manual Release Creator #31

Workflow file for this run

name: Manual Release Creator
on:
workflow_dispatch:
inputs:
tag_name:
description: 'The tag name for the release (e.g., v0.1.0-test)'
required: true
default: 'v0.1.0-alpha'
jobs:
build-and-release:
strategy:
matrix:
include:
- os: windows-latest
goos: windows
goarch: amd64
arch_name: "64"
- os: ubuntu-latest
goos: linux
goarch: amd64
arch_name: "64"
- os: macos-latest
goos: darwin
goarch: amd64
arch_name: "64"
- os: macos-latest
goos: darwin
goarch: arm64
arch_name: "arm64-v8a"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install Zip tool (for Windows only)
if: runner.os == 'Windows'
run: choco install zip
- name: Install Dependencies
run: go mod tidy
working-directory: ./core_engine
- name: Set output names
id: set_names
shell: bash
run: |
EXE_NAME="core_engine"
if [ "${{ matrix.goos }}" == "windows" ]; then EXE_NAME="core_engine.exe"; fi
echo "EXE_NAME=$EXE_NAME" >> $GITHUB_ENV
echo "ZIP_NAME=core_engine-${{ matrix.goos }}-${{ matrix.arch_name }}.zip" >> $GITHUB_ENV
- name: Build Go Executable
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build -v -o ${{ env.EXE_NAME }} .
working-directory: ./core_engine
- name: Create Zip Archive
shell: bash
run: |
cd core_engine
zip ${{ env.ZIP_NAME }} ${{ env.EXE_NAME }}
- name: Upload Artifact for the Release job
uses: actions/upload-artifact@v4
with:
name: release-asset-${{ matrix.goos }}-${{ matrix.arch_name }}
path: core_engine/${{ env.ZIP_NAME }}
create-release:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create dummy commit for release
run: |
echo "Release ${{ github.event.inputs.tag_name }}" > RELEASE_TAG.txt
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add RELEASE_TAG.txt
git commit -m "chore: prepare release ${{ github.event.inputs.tag_name }}"
git push origin HEAD:main
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag_name }}
name: "Release ${{ github.event.inputs.tag_name }}"
body: ""
files: artifacts/**/*.zip