From 9cd7bf0b8c720d255232a389051fb60f5fc92c2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= <patrickelectric@gmail.com>
Date: Thu, 18 Jul 2024 14:58:10 -0300
Subject: [PATCH] deploy: Fix action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
---
 .github/workflows/deploy.yml | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 8472042..8924491 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -12,7 +12,7 @@ jobs:
     - uses: actions/checkout@master
       with:
         fetch-depth: 0
-        ref: ${{ github.event.pull_request.head.ref }}
+        ref: ${{ github.event.repository.default_branch }}
     - uses: actions-rs/toolchain@v1.0.7
       with:
         toolchain: stable
@@ -22,15 +22,19 @@ jobs:
     - name: Extract version from tag
       id: get_version
       run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
-    - name: Login to crates.io
-      uses: actions-rs/cargo@v1
-      with:
-        command: login
-        args: ${{ secrets.CARGO }}
+    - name: Commit version changes
+      run: |
+        git config --global user.name 'github-actions[bot]'
+        git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
     - name: Set and publish workspace crates
+      env:
+        CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO }}
       run: |
         cargo install cargo-workspaces
         cargo workspaces version custom ${{ steps.get_version.outputs.version }} \
-          --exact --yes --no-individual-tags \
+          --exact --yes --no-git-tag --no-git-push \
           -m "Commit new release ${{ steps.get_version.outputs.version }}"
-        cargo workspaces publish --yes --no-verify
+        cargo workspaces publish --yes --no-verify --publish-as-is
+    - name: Push commit
+      run: |
+        git push origin ${{ github.event.repository.default_branch }}
-- 
GitLab