Skip to content

Commit 421962e

Browse files
committed
Aha, lets use a manual workflow dispatch for releases for now
1 parent 78053cc commit 421962e

File tree

3 files changed

+15
-49
lines changed

3 files changed

+15
-49
lines changed

.github/workflows/release.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: Release
1717
permissions:
1818
"contents": "write"
1919

20-
# This task will run whenever you push a git tag that looks like a version
20+
# This task will run whenever you workflow_dispatch with a tag that looks like a version
2121
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
2222
# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
2323
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
@@ -39,19 +39,23 @@ permissions:
3939
# If there's a prerelease-style suffix to the version, then the release(s)
4040
# will be marked as a prerelease.
4141
on:
42-
push:
43-
tags:
44-
- '**[0-9]+.[0-9]+.[0-9]+*'
42+
workflow_dispatch:
43+
inputs:
44+
tag:
45+
description: Release Tag
46+
required: true
47+
default: dry-run
48+
type: string
4549

4650
jobs:
4751
# Run 'dist plan' (or host) to determine what tasks we need to do
4852
plan:
4953
runs-on: "ubuntu-20.04"
5054
outputs:
5155
val: ${{ steps.plan.outputs.manifest }}
52-
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
53-
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
54-
publishing: ${{ !github.event.pull_request }}
56+
tag: ${{ (inputs.tag != 'dry-run' && inputs.tag) || '' }}
57+
tag-flag: ${{ inputs.tag && inputs.tag != 'dry-run' && format('--tag={0}', inputs.tag) || '' }}
58+
publishing: ${{ inputs.tag && inputs.tag != 'dry-run' }}
5559
env:
5660
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5761
steps:
@@ -75,7 +79,7 @@ jobs:
7579
# but also really annoying to build CI around when it needs secrets to work right.)
7680
- id: plan
7781
run: |
78-
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
82+
dist ${{ (inputs.tag && inputs.tag != 'dry-run' && format('host --steps=create --tag={0}', inputs.tag)) || 'plan' }} --output-format=json > plan-dist-manifest.json
7983
echo "dist ran successfully"
8084
cat plan-dist-manifest.json
8185
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -91,7 +95,7 @@ jobs:
9195
# Let the initial task tell us to not run (currently very blunt)
9296
needs:
9397
- plan
94-
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
98+
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') || inputs.tag == 'dry-run' }}
9599
strategy:
96100
fail-fast: false
97101
# Target platforms/runners are computed by dist in create-release.

.github/workflows/tag.yml

-40
This file was deleted.

dist-workspace.toml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-
2121
auto-includes = false
2222
# Which actions to run on pull requests (use "upload" to force a build in CI for testing)
2323
pr-run-mode = "skip"
24+
# Whether CI should trigger releases with dispatches instead of tag pushes
25+
dispatch-releases = true
2426
# Path that installers should place binaries in
2527
install-path = ["$XDG_BIN_HOME/", "$XDG_DATA_HOME/../bin", "~/.local/bin"]
2628
# Whether to install an updater program

0 commit comments

Comments
 (0)