diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93af81e..d0f1b65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,6 +63,11 @@ jobs: # failing. otherwise `sh` won't catch that `curl` returned non-0 shell: bash run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.17.0-prerelease.1/cargo-dist-installer.sh | sh" + - name: Cache cargo-dist + uses: actions/upload-artifact@v4 + with: + name: cargo-dist-cache + path: ~/.cargo/bin/cargo-dist # sure would be cool if github gave us proper conditionals... # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible # functionality based on whether this is a pull_request, and whether it's from a fork. @@ -166,9 +171,12 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install cargo-dist - shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.17.0-prerelease.1/cargo-dist-installer.sh | sh" + - name: Install cached cargo-dist + uses: actions/download-artifact@v4 + with: + name: cargo-dist-cache + path: ~/.cargo/bin/ + - run: chmod +x ~/.cargo/bin/cargo-dist # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts uses: actions/download-artifact@v4 @@ -212,8 +220,12 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.17.0-prerelease.1/cargo-dist-installer.sh | sh" + - name: Install cached cargo-dist + uses: actions/download-artifact@v4 + with: + name: cargo-dist-cache + path: ~/.cargo/bin/ + - run: chmod +x ~/.cargo/bin/cargo-dist # Fetch artifacts from scratch-storage - name: Fetch artifacts uses: actions/download-artifact@v4 @@ -221,7 +233,6 @@ jobs: pattern: artifacts-* path: target/distrib/ merge-multiple: true - # This is a harmless no-op for GitHub Releases, hosting for that happens in "announce" - id: host shell: bash run: | @@ -235,23 +246,7 @@ jobs: # Overwrite the previous copy name: artifacts-dist-manifest path: dist-manifest.json - - # Create a GitHub Release while uploading all files to it - announce: - needs: - - plan - - host - # use "always() && ..." to allow us to wait for all publish jobs while - # still allowing individual publish jobs to skip themselves (for prereleases). - # "host" however must run to completion, no skipping allowed! - if: ${{ always() && needs.host.result == 'success' }} - runs-on: "ubuntu-20.04" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive + # Create a GitHub Release while uploading all files to it - name: "Download GitHub Artifacts" uses: actions/download-artifact@v4 with: @@ -264,12 +259,28 @@ jobs: rm -f artifacts/*-dist-manifest.json - name: Create GitHub Release env: - PRERELEASE_FLAG: "${{ fromJson(needs.host.outputs.val).announcement_is_prerelease && '--prerelease' || '' }}" - ANNOUNCEMENT_TITLE: "${{ fromJson(needs.host.outputs.val).announcement_title }}" - ANNOUNCEMENT_BODY: "${{ fromJson(needs.host.outputs.val).announcement_github_body }}" + PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}" + ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}" + ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}" + RELEASE_COMMIT: "${{ github.sha }}" run: | # Write and read notes from a file to avoid quoting breaking things echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt - gh release create "${{ needs.plan.outputs.tag }}" --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" $PRERELEASE_FLAG - gh release upload "${{ needs.plan.outputs.tag }}" artifacts/* + gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* + + announce: + needs: + - plan + - host + # use "always() && ..." to allow us to wait for all publish jobs while + # still allowing individual publish jobs to skip themselves (for prereleases). + # "host" however must run to completion, no skipping allowed! + if: ${{ always() && needs.host.result == 'success' }} + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive diff --git a/axolotlsay-js/dist.toml b/axolotlsay-js/dist.toml index ae6a5ae..c9f213c 100644 --- a/axolotlsay-js/dist.toml +++ b/axolotlsay-js/dist.toml @@ -1,8 +1,2 @@ [package] -name = "axolotlsay-js" -description = "JavaScript port of axolotlsay" -version = "0.9.0" -license = "MIT" -repository = "https://github.com/axodotdev/axolotlsay-hybrid" -binaries = ["axolotlsay-js"] build-command = ["bash", "build.sh"] diff --git a/axolotlsay-js/package.json b/axolotlsay-js/package.json index c70d4c8..e0c9ab9 100644 --- a/axolotlsay-js/package.json +++ b/axolotlsay-js/package.json @@ -1,10 +1,11 @@ { - "name": "axolotlsay", + "name": "axolotlsay-js", "version": "0.9.0", - "description": "> 📄 a template for axodotdev's open source repositories", + "description": "JavaScript port of axolotlsay", + "repository": "https://github.com/axodotdev/axolotlsay-hybrid", "main": "index.js", "bin": { - "axolotlsay": "./bin/index.js" + "axolotlsay-js": "./bin/index.js" }, "keywords": ["cli"], "author": "axodotdev ", diff --git a/dist-workspace.toml b/dist-workspace.toml index d749fb5..b8dc55b 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -1,7 +1,5 @@ [workspace] -members = ["axolotlsay-js"] -cargo-workspaces = ["crates"] -resolver = "2" +members = ["cargo:crates", "npm:axolotlsay-js"] # Config for 'cargo dist' [dist]