From 71ed3569ce9819ceaaa312ab3013e3ac03f7114f Mon Sep 17 00:00:00 2001 From: Suhas Thalanki <54014218+thesuhas@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:36:29 -0400 Subject: [PATCH] Release action (#185) * added release action * removed pr as cant add tags to pr * reverted edition * updated to push tag * updated tag * added code checkout * added the appropriate actions checkout * added manual dispatch * added release_type * removed steps * added to commit updates after version bump * updated ordering of fields * updated workflows * removed lock as ignored by gitignore * added branch main * new workflow --- .github/workflows/publish.yml | 19 +++++++++++++++++++ .github/workflows/release.yml | 7 +++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d8e27d2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish + +on: + pull_request: + types: + - closed + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + publish: + runs-on: ubuntu-latest + if: github.event.pull_request.merge == true && github.event.pull_request.head == 'automated_release' && github.event.pull_request.base == 'main' + steps: + - name: Publish Update + run: cargo publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66cc8d2..1a6352f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,7 @@ jobs: permissions: # Gives write permisison to commit toml changes contents: write + pull-requests: write steps: - name: cargo login @@ -61,7 +62,5 @@ jobs: with: commit_message: Version Bump file_pattern: 'Cargo.toml' - branch: main - - - name: cargo publish - run: cargo publish \ No newline at end of file + branch: automated-release + create_branch: 'true' \ No newline at end of file