Skip to content

fix gha builds

fix gha builds #14

Workflow file for this run

name: Draft New Release

Check failure on line 1 in .github/workflows/draft-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/draft-release.yml

Invalid workflow file

(Line: 43, Col: 15): Unrecognized named-value: 'github'. Located at position 1 within expression: github.ref, (Line: 50, Col: 15): Unrecognized named-value: 'github'. Located at position 1 within expression: github.ref
on:
push:
branches:
- main
permissions:
contents: write
id-token: write
packages: write
jobs:
# This job orchestrates the builds and release creation
release-orchestrator:
runs-on: ubuntu-latest # Can be ubuntu-latest or a small runner since it only calls other workflows and downloads artifacts
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# 1. Get short (7 characters long) commit SHA code (needed for the release tag/name)
- name: Extract short SHA
id: extract_sha
shell: bash
run: |
full_sha="${{ github.sha }}"
short_sha="${full_sha:0:7}"
echo "short_sha=$short_sha" >> $GITHUB_OUTPUT
# 2. Extract only the commit description (body)
- name: Extract commit description
id: extract_desc
shell: bash
run: |
desc=$(git log -1 --pretty=%B | tail -n +3)
echo "commit_description<<EOF" >> $GITHUB_OUTPUT
echo "$desc" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# 3. Call UNIX Build Workflow
- name: Call UNIX Build Workflow
# Corrected: Hardcoding repository name as requested
uses: monitio/tread/.github/workflows/build-unix.yml@${{ github.ref }}
id: unix_build
with: {} # Explicit empty 'with' block for workflows with no inputs
# 4. Call Windows Build Workflow
- name: Call Windows Build Workflow
# Corrected: Hardcoding repository name as requested
uses: monitio/tread/.github/workflows/build-win.yml@${{ github.ref }}
id: win_build
with:
short_sha: ${{ steps.extract_sha.outputs.short_sha }} # Pass extracted info as inputs
commit_description: ${{ steps.extract_desc.outputs.commit_description }}
# 5. Download UNIX Binary Artifact
- name: Download UNIX Binary Artifact
uses: actions/download-artifact@v4
with:
name: tread-bin-UNIX # Name must match the artifact name in build-unix.yml
path: ./.
# 6. Download Windows Binary Artifact
- name: Download Windows Binary Artifact
uses: actions/download-artifact@v4
with:
name: tread-bin-WIN # Name must match the artifact name in build-win.yml
path: ./.
# 7. Create the draft pre-release and attach both assets
- name: Create Draft GitHub Release with Both Assets
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.extract_sha.outputs.short_sha }}
name: Pre-release v${{ steps.extract_sha.outputs.short_sha }}
draft: true
prerelease: true
body: |
Pre-release v${{ steps.extract_sha.outputs.short_sha }}
**Triggered by committer:** @${{ github.actor }}
---
# What's changed?
${{ steps.extract_desc.outputs.commit_description }}
files: |
./tread-bin-UNIX.zip
./tread-bin-WIN.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}