Create beta release #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create beta release | |
on: | |
workflow_dispatch: | |
inputs: | |
next: | |
description: 'The next increment to create the release for' | |
required: true | |
default: 'minor' | |
type: choice | |
options: | |
- major | |
- minor | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch tags | |
run: git fetch --force --tags | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Set up Task | |
uses: arduino/setup-task@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up chocolatey | |
run: | | |
mkdir -p /opt/chocolatey | |
wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey" | |
echo '#!/bin/bash' >> /usr/local/bin/choco | |
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco | |
chmod +x /usr/local/bin/choco | |
env: | |
CHOCOLATEY_VERSION: 1.2.1 | |
- name: Set up nix | |
uses: cachix/install-nix-action@v19 | |
- name: Get goreleaser app token | |
id: get-app-token | |
uses: labd/action-gh-app-token@main | |
with: | |
app-id: ${{ secrets.MCI_APP_ID }} | |
private-key: ${{ secrets.MCI_APP_PRIVATE_KEY }} | |
installation-id: ${{ secrets.MCI_APP_INSTALLATION_ID }} | |
- name: Get hash | |
shell: bash | |
run: | | |
HASH=$(git rev-parse --short "$GITHUB_SHA") | |
echo "HASH=$HASH" >> $GITHUB_ENV | |
- name: Get the next potential version | |
id: next-tag | |
uses: miniscruff/changie-action@v2 | |
with: | |
version: latest | |
args: next -p beta-${{ env.HASH }} ${{ github.event.inputs.next }} | |
- name: Output changes | |
uses: miniscruff/changie-action@v2 | |
id: changelog | |
with: | |
version: latest | |
args: batch --dry-run -p beta-${{ env.HASH }} ${{ github.event.inputs.next }} | |
- name: Save ChangeLog to file | |
id: save_changes | |
run: | | |
tmpfile=$(mktemp) | |
echo "${{ steps.changelog.outputs.output }}" > $tmpfile | |
echo "changelog_file=$tmpfile" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: release --clean --skip=validate --release-notes ${{ steps.save_changes.outputs.changelog_file }} | |
env: | |
GORELEASER_CURRENT_TAG: ${{ steps.next-tag.outputs.output }} | |
GITHUB_TOKEN: ${{ steps.get-app-token.outputs.app-token }} | |
GOPATH: ${{ env.GOPATH }} | |
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} | |
SKIP_UPLOAD: true | |
- name: Upload release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mach-composer | |
path: dist/* |