|
42 | 42 | pull_request: |
43 | 43 | push: |
44 | 44 | 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]+*' |
52 | 46 |
|
53 | 47 | jobs: |
54 | 48 | # Run 'dist plan' (or host) to determine what tasks we need to do |
55 | 49 | plan: |
56 | 50 | runs-on: "ubuntu-22.04" |
57 | 51 | outputs: |
58 | 52 | 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 }} |
62 | 56 | env: |
63 | 57 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
64 | 58 | steps: |
65 | 59 | - uses: actions/checkout@v4 |
66 | 60 | with: |
67 | 61 | persist-credentials: false |
68 | 62 | submodules: recursive |
69 | | - ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} |
70 | 63 | - name: Install dist |
71 | 64 | # we specify bash to get pipefail; it guards against the `curl` command |
72 | 65 | # failing. otherwise `sh` won't catch that `curl` returned non-0 |
|
84 | 77 | # but also really annoying to build CI around when it needs secrets to work right.) |
85 | 78 | - id: plan |
86 | 79 | 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 |
88 | 81 | echo "dist ran successfully" |
89 | 82 | cat plan-dist-manifest.json |
90 | 83 | echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT" |
|
0 commit comments