Skip to content

release.yml

release.yml #30

Workflow file for this run

name: release.yml
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g., v1.0.0)'
required: true
type: string
prerelease:
description: 'Is this a prerelease?'
required: false
type: boolean
default: false
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify versions are up to date
run: |
files=(
"build.gradle.kts"
"src/test/resources/snapshots/AstraCli/help_output.human.approved.txt"
)
tag="${{ inputs.tag }}"
missing_files=()
for f in "${files[@]}"; do
if ! grep -q "${tag#v}" "$f"; then
missing_files+=("$f")
fi
done
if [ ${#missing_files[@]} -ne 0 ]; then
echo "ERROR: Version not found in the following files:"
printf '%s\n' "${missing_files[@]}"
exit 1
fi
build:
needs: verify
uses: ./.github/workflows/build.yml
with:
upload-artifacts: true
build-all-platforms: true
update-install-scripts:
needs: build
uses: ./.github/workflows/update-install-scripts.yml
permissions:
contents: write
pull-requests: write
with:
tag: ${{ inputs.tag }}
release:
needs: [build, update-install-scripts]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag }}
name: ${{ inputs.tag }}
prerelease: ${{ inputs.prerelease }}
files: |
artifacts/astra-cli-linux-x86_64/*
artifacts/astra-cli-windows-x86_64/*
artifacts/astra-cli-linux-arm64/*
artifacts/astra-cli-macos-x86_64/*
artifacts/astra-cli-macos-arm64/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}