From f208fe0dde8becf4712eaca0de37cd410e263c2e Mon Sep 17 00:00:00 2001 From: Rinde van Lon Date: Wed, 9 Oct 2024 15:11:17 +0100 Subject: [PATCH] use release-plz --- .github/pull_request_template.md | 7 +++++ .github/workflows/publish.yaml | 53 -------------------------------- .github/workflows/release.yaml | 33 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 53 deletions(-) create mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..1e57dda --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ +Please start the title of the pull-request with either: + +fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, or test: + +append a `!` after the name but before the colon to indicate a breaking change, e.g. fix!: + +For more information see [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary). diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 9cbf387..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Publish - -on: - push: - branches: - - main - -jobs: - release-on-push: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.BOT_ACCOUNT_PAT }} - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - name: Calculate next version - id: calc_version - uses: rymndhng/release-on-push-action@master - with: - bump_version_scheme: patch - tag_prefix: "" - dry_run: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set version - if: ${{ steps.calc_version.outputs.version != '' }} - run: | - sed -i "s/^version = \".*\"$/version = \"${{ steps.calc_version.outputs.version }}\"/" Cargo.toml - - name: Publish new version to main - if: ${{ steps.calc_version.outputs.version != '' }} - run: | - git config --global user.email "rust-maintainers@moiaorg.onmicrosoft.com" - git config --global user.name "MOIA Rust Maintainers" - git commit -am "Release ${{ steps.calc_version.outputs.version }} [skip ci]" - git push - - name: Create github release - if: ${{ steps.calc_version.outputs.version != '' }} - uses: rymndhng/release-on-push-action@master - with: - bump_version_scheme: patch - tag_prefix: "" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish - if: ${{ steps.calc_version.outputs.version != '' }} - run: cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ea59df1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: Run Release Plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: taiki-e/install-action@v2 + with: + tool: just + - run: | + echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file