From 8f40dcb843243073258978dd2975611dfb499752 Mon Sep 17 00:00:00 2001 From: jindaxia Date: Tue, 23 Feb 2021 13:10:37 +0800 Subject: [PATCH] fix create release exists error --- .github/workflows/upload_release.yml | 39 ++++++++++++++++------------ 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/upload_release.yml b/.github/workflows/upload_release.yml index 8e89225..e617b90 100644 --- a/.github/workflows/upload_release.yml +++ b/.github/workflows/upload_release.yml @@ -7,9 +7,25 @@ on: name: Upload Release Asset jobs: + create-release-tag: + name: Create The Release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false build-linux: runs-on: ubuntu-16.04 - + needs: create-release-tag steps: - name: Install dependencies run: sudo apt-get install libusb-1.0-0-dev libudev-dev @@ -34,31 +50,20 @@ jobs: cd target tar cfJ flasher-linux.tar.xz "Sonix Keyboard Flasher" - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.create-release-tag.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: target/flasher-linux.tar.xz asset_name: flasher-linux.tar.xz asset_content_type: application/zip build-mac: runs-on: macos-10.15 - + needs: create-release-tag steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v1 @@ -94,14 +99,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.create-release-tag.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: flasher-mac.dmg asset_name: flasher-mac.dmg asset_content_type: application/zip build-win: runs-on: windows-2019 - + needs: create-release-tag steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v1 @@ -137,7 +142,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.create-release-tag.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: flasher-win.zip asset_name: flasher-win.zip asset_content_type: application/zip