From 46b384c644c8fc7dad5ec0b5bb79638b9d6cb64b Mon Sep 17 00:00:00 2001 From: EdenEast Date: Mon, 11 Sep 2023 18:09:59 -0400 Subject: [PATCH] wip --- .github/workflows/release.yml | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e7d9b12 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +# https://sourcegraph.com/github.com/martinohmann/dts/-/blob/.github/workflows/release-please.yml +# https://sourcegraph.com/github.com/kabouzeid/turm/-/blob/.github/workflows/release.yml +# https://github.com/starship/starship/blob/master/.github/workflows/release.yml +name: release please +on: + workflow_dispatch: + inputs: + force-publish-crate: + required: true + type: boolean + description: Publish crate even if no new release was created. + force-publish-packages: + required: true + type: boolean + description: Publish packages even if no new release was created. + push: + branches: + - main + +env: + CARGO_INCREMENTAL: 0 + +jobs: + release_please: + name: Release Please + runs-on: ubuntu-latest + if: github.repository == 'edeneast/tuxmux' + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: rust + bump-minor-pre-major: true + package-name: tuxmux + draft: true + + publish-crate: + needs: release-please + if: ${{ needs.release-please.outputs.release_created || github.events.inputs.force-publish-crate == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Setup | Checkout + uses: actions/checkout@v4 + + - name: Install rust + + - name: Setup | Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build | Publish to crates.io + run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} + + publish-packages: + needs: release-please + if: ${{ needs.release-please.outputs.release_created || github.event.inputs.force-publish-packages == 'true' }} + name: Package ${{ matrix.target }} (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + env: + # Emit backtraces on panics. + RUST_BACKTRACE: 1 +