mirror of https://github.com/buster-so/buster.git
one more try
This commit is contained in:
parent
17a5f34842
commit
d3949cbd71
|
@ -2,18 +2,28 @@ name: CLI Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["Manage Versions"] # Name of the manage-versions.yml workflow
|
workflows: ["Manage Versions"]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
manage_versions_run_id:
|
||||||
|
description: 'Run ID of the completed "Manage Versions" workflow (that produced version-tag-info artifact)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
checkout_sha:
|
||||||
|
description: 'Commit SHA to checkout (ideally the head_sha from the Manage Versions run)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
# Add permissions for creating releases
|
# Add permissions for creating releases
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write # May not be needed if PRs don't trigger this directly
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event.workflow_run.conclusion == 'success'
|
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -38,8 +48,8 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.workflow_run.head_sha }} # Checkout the commit from the completed manage-versions run
|
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.checkout_sha || github.event.workflow_run.head_sha }}
|
||||||
fetch-depth: 0 # Important for release notes generation
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
@ -110,7 +120,7 @@ jobs:
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.workflow_run.conclusion == 'success'
|
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch'
|
||||||
outputs:
|
outputs:
|
||||||
release_tag: ${{ steps.get_tag_info.outputs.cli_tag_name }}
|
release_tag: ${{ steps.get_tag_info.outputs.cli_tag_name }}
|
||||||
release_version: ${{ steps.get_tag_info.outputs.cli_version }}
|
release_version: ${{ steps.get_tag_info.outputs.cli_version }}
|
||||||
|
@ -118,15 +128,15 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.workflow_run.head_sha }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.checkout_sha || github.event.workflow_run.head_sha }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Download Tag Information Artifact from Manage Versions workflow
|
- name: Download Tag Information Artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: version-tag-info
|
name: version-tag-info
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }} # Token to download artifact from another workflow run
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run-id: ${{ github.event.workflow_run.id }}
|
run-id: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.manage_versions_run_id || github.event.workflow_run.id }}
|
||||||
|
|
||||||
- name: Extract CLI Tag and Version from Artifact
|
- name: Extract CLI Tag and Version from Artifact
|
||||||
id: get_tag_info
|
id: get_tag_info
|
||||||
|
|
Loading…
Reference in New Issue