From bf600d47871cc3d44fd490e5fdf111abdec74ce2 Mon Sep 17 00:00:00 2001 From: qydysky <32743305+qydysky@users.noreply.github.com> Date: Sun, 19 Feb 2023 22:41:41 +0800 Subject: [PATCH] Improve github Node.js 12 actions are deprecated. --- .github/workflows/go.yml | 33 ++++++--------------------------- .github/workflows/test.yml | 8 ++++---- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 89c8bfc..0414a9d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,12 +24,8 @@ jobs: - name: set upload_url id: set_upload_url - uses: noobly314/share-data@v1 - with: - share-id: release_url - mode: set - key: url - value: ${{ steps.create_release.outputs.upload_url }} + run: | + echo "release_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV u-build: name: build_ubuntu_go${{ matrix.go }} @@ -45,7 +41,7 @@ jobs: go-version: ${{ matrix.go }} - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build run: | @@ -58,14 +54,6 @@ jobs: - name: zip run: zip -q -r ubuntu_go${{ matrix.go }}.zip * - - - name: get upload_url - id: get_upload_url - uses: noobly314/share-data@v1 - with: - share-id: release_url - mode: get - key: url - name: Upload a Release Asset uses: actions/upload-release-asset@v1.0.2 @@ -73,7 +61,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # The URL for uploading assets to the release - upload_url: ${{ steps.get_upload_url.outputs.data }} + upload_url: ${{ env.release_url }} # The path to the asset you want to upload asset_path: ./ubuntu_go${{ matrix.go }}.zip # The name of the asset you want to upload @@ -95,7 +83,7 @@ jobs: go-version: ${{ matrix.go }} - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build run: | @@ -106,22 +94,13 @@ jobs: - name: zip run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./ - - - name: get upload_url - id: get_upload_url - uses: noobly314/share-data@v1 - with: - share-id: release_url - mode: get - key: url - - name: Upload a Release Asset uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # The URL for uploading assets to the release - upload_url: ${{ steps.get_upload_url.outputs.data }} + upload_url: ${{ env.release_url }} # The path to the asset you want to upload asset_path: ./windows_go${{ matrix.go }}.zip # The name of the asset you want to upload diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eed9945..3d89eef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: go-version: ${{ matrix.go }} - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build run: | @@ -34,7 +34,7 @@ jobs: run: zip -q -r ubuntu_go${{ matrix.go }}.zip * - name: Upload a Build Artifact - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v3 with: path: ./ubuntu_go${{ matrix.go }}.zip @@ -51,7 +51,7 @@ jobs: go-version: ${{ matrix.go }} - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build run: | @@ -63,6 +63,6 @@ jobs: run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./ - name: Upload a Build Artifact - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v3 with: path: ./windows_go${{ matrix.go }}.zip -- 2.39.2