Skip to content

Commit ed17f4f

Browse files
committed
cargo-dist
1 parent aaafd04 commit ed17f4f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,24 @@ on:
4242
pull_request:
4343
push:
4444
tags:
45-
- "**[0-9]+.[0-9]+.[0-9]+*"
46-
workflow_dispatch:
47-
inputs:
48-
tag:
49-
description: "Version tag (e.g., v0.1.0)"
50-
required: true
51-
type: string
45+
- '**[0-9]+.[0-9]+.[0-9]+*'
5246

5347
jobs:
5448
# Run 'dist plan' (or host) to determine what tasks we need to do
5549
plan:
5650
runs-on: "ubuntu-22.04"
5751
outputs:
5852
val: ${{ steps.plan.outputs.manifest }}
59-
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || (!github.event.pull_request && github.ref_name || '') }}
60-
tag-flag: ${{ (github.event_name == 'workflow_dispatch' && format('--tag={0}', github.event.inputs.tag)) || (!github.event.pull_request && format('--tag={0}', github.ref_name) || '') }}
61-
publishing: ${{ !github.event.pull_request && github.event_name != 'workflow_dispatch' || github.event_name == 'workflow_dispatch' }}
53+
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
54+
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
55+
publishing: ${{ !github.event.pull_request }}
6256
env:
6357
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6458
steps:
6559
- uses: actions/checkout@v4
6660
with:
6761
persist-credentials: false
6862
submodules: recursive
69-
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
7063
- name: Install dist
7164
# we specify bash to get pipefail; it guards against the `curl` command
7265
# failing. otherwise `sh` won't catch that `curl` returned non-0
@@ -84,7 +77,7 @@ jobs:
8477
# but also really annoying to build CI around when it needs secrets to work right.)
8578
- id: plan
8679
run: |
87-
dist plan ${{ (github.event_name == 'workflow_dispatch' && format('--tag={0}', github.event.inputs.tag)) || (!github.event.pull_request && format('--tag={0}', github.ref_name) || '') }} --output-format=json > plan-dist-manifest.json
80+
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
8881
echo "dist ran successfully"
8982
cat plan-dist-manifest.json
9083
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)