From 6c3ff89ea5b179500e433d4fdc396ad997c425a4 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 23 Sep 2024 22:59:43 -0300 Subject: [PATCH] feat(ci): replace deprecated action wih gh CLI --- .github/workflows/build-release.yml | 61 ++++++++--------------- .github/workflows/build-test-and-lint.yml | 4 +- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index d81f11c..6553309 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -60,10 +60,6 @@ jobs: title: '${{ github.ref_name }}' parameters: '${{ toJson(inputs) }}' content: | - ```json - ${{ toJson(job) }} - ``` - ### Release information - Tag Name: ${{ github.event.release.tag_name }} - Commit SHA: ${{ github.sha }} @@ -146,49 +142,34 @@ jobs: # region Upload Artifact - - name: Upload Debian Package - uses: actions/upload-release-asset@v1 - if: matrix.platform == 'linux' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.deb - asset_name: ${{ env.ARTIFACT_NAME }}.deb - asset_content_type: application/vnd.debian.binary-package - - - name: Upload RPM Package - uses: actions/upload-release-asset@v1 + - name: Upload Debian, RPM and tar.gz Packages if: matrix.platform == 'linux' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.rpm - asset_name: ${{ env.ARTIFACT_NAME }}.rpm - asset_content_type: application/x-rpm + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + run: | + gh release upload --clobber ${{ env.RELEASE_VERSION }} ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.rpm + gh release upload --clobber ${{ env.RELEASE_VERSION }} ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.deb + gh release upload --clobber ${{ env.RELEASE_VERSION }} ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.tar.gz - - name: Upload linux binary package - uses: actions/upload-release-asset@v1 - if: matrix.platform == 'linux' || matrix.platform == 'macos' + - name: Upload MacOS Tar package + if: matrix.platform == 'macos' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.tar.gz - asset_name: ${{ env.ARTIFACT_NAME }}.tar.gz - asset_content_type: application/octet-stream + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + run: | + gh release upload --clobber ${{ env.RELEASE_VERSION }} ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.tar.gz - - name: Upload windows binary package - uses: actions/upload-release-asset@v1 + - name: Upload Windows Zip package if: matrix.platform == 'windows' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.zip - asset_name: ${{ env.ARTIFACT_NAME }}.zip - asset_content_type: application/octet-stream + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + run: | + gh release upload --clobber ${{ env.RELEASE_VERSION }} ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}.zip # endregion diff --git a/.github/workflows/build-test-and-lint.yml b/.github/workflows/build-test-and-lint.yml index e80a9f8..fbce83a 100644 --- a/.github/workflows/build-test-and-lint.yml +++ b/.github/workflows/build-test-and-lint.yml @@ -42,9 +42,7 @@ jobs: title: '${{ github.ref_name }}' parameters: '${{ toJson(inputs) }}' content: | - ```json - ${{ toJson(job) }} - ``` + - Ref: ${{ github.head_ref }} ci: needs: run_when