Skip to content

Commit

Permalink
fix create release exists error
Browse files Browse the repository at this point in the history
  • Loading branch information
jindaxia committed Feb 23, 2021
1 parent 3ebb50f commit 8f40dcb
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/upload_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 8f40dcb

Please sign in to comment.