diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05366c3c..48012559 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,15 +123,30 @@ jobs: - run: just avoid-dev-deps - run: just lint + pr-info: + outputs: + is-release: ${{ steps.meta.outputs.is-release }} + crate: ${{ steps.meta.outputs.crates-names }} + + runs-on: ubuntu-latest + steps: + - id: meta + if: github.event_name == 'pull_request' + uses: cargo-bins/release-meta@v1 + with: + event-data: ${{ toJSON(github.event) }} + extract-notes-under: '### Release notes' + release-dry-run: + needs: pr-info uses: ./.github/workflows/release-cli.yml - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || needs.pr-info.outputs.is-release == 'true' secrets: inherit with: info: | { "is-release": false, - "crate": "cargo-binstall", + "crate": "${{ needs.pr-info.outputs.crate }}", "version": "0.0.0", "notes": "" } diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 80b94fda..677fb6ce 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -83,17 +83,15 @@ jobs: with: name: minisign.pub - - uses: ./.github/actions/just-setup - - run: .github/scripts/ephemeral-crate.sh - - if: fromJSON(inputs.info).is-release != 'true' + - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: DRY-RUN Publish to crates.io env: crate: ${{ fromJSON(inputs.info).crate }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo package -p "$crate" --allow-dirty --no-default-features - - if: fromJSON(inputs.info).is-release != 'true' + run: cargo publish --dry-run -p "$crate" --allow-dirty --no-default-features + - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: Upload crate package as artifact uses: actions/upload-artifact@v3 with: