Skip to content

Commit

Permalink
feat: refresh dist-manifest after hosting --steps=release
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Nov 22, 2023
1 parent 442a920 commit 6f27c42
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 63 deletions.
20 changes: 15 additions & 5 deletions cargo-dist/templates/ci/github_ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ jobs:
AXO_RELEASES_TOKEN: ${{ secrets.AXO_RELEASES_TOKEN }}
{{%- endif %}}
runs-on: {{{ global_task.runner }}}
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -295,10 +297,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json
{{%- if 'homebrew' in publish_jobs and tap %}}
Expand Down Expand Up @@ -401,14 +411,14 @@ jobs:
with:
tag: ${{ needs.plan.outputs.tag }}
{{%- if create_release %}}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
{{%- else %}}
allowUpdates: true
updateOnlyUnreleased: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
{{%- endif %}}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
{{%- endif %}}
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/akaikatana_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -1516,10 +1518,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

publish-homebrew-formula:
needs: [plan, should-publish]
Expand Down Expand Up @@ -1578,9 +1588,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/akaikatana_musl.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -1200,10 +1202,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

# Create a Github Release with all the results once everything is done
announce-release:
Expand All @@ -1228,9 +1238,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -1516,10 +1518,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

publish-homebrew-formula:
needs: [plan, should-publish]
Expand Down Expand Up @@ -1578,9 +1588,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_abyss.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,8 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AXO_RELEASES_TOKEN: ${{ secrets.AXO_RELEASES_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -2443,10 +2445,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

# Create an Announcement for all the Axo Releases

Expand Down Expand Up @@ -2484,9 +2494,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
================ main.wxs ================
Expand Down
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -2432,10 +2434,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

publish-homebrew-formula:
needs: [plan, should-publish]
Expand Down Expand Up @@ -2494,9 +2504,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
================ main.wxs ================
Expand Down
16 changes: 13 additions & 3 deletions cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -2407,10 +2409,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

publish-homebrew-formula:
needs: [plan, should-publish]
Expand Down Expand Up @@ -2473,7 +2483,7 @@ jobs:
updateOnlyUnreleased: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_musl.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -2095,10 +2097,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

# Create a Github Release with all the results once everything is done
announce-release:
Expand All @@ -2123,9 +2133,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
20 changes: 15 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -2041,10 +2043,18 @@ jobs:
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
- id: host
shell: bash
run: |
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

# Create a Github Release with all the results once everything is done
announce-release:
Expand All @@ -2069,9 +2079,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
name: ${{ fromJson(needs.should-publish.outputs.val).announcement_title }}
body: ${{ fromJson(needs.should-publish.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.should-publish.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
Loading

0 comments on commit 6f27c42

Please sign in to comment.