diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdd94ee..abc8e16 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,12 +51,35 @@ jobs: run: | cd build zip -r bin.zip bin/ - + - name: Upload Artifact uses: actions/upload-artifact@v2 with: name: build-bin-${{ runner.os }} - path: build/bin/ + path: build/bin.zip + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: build-bin-ubuntu-latest + path: ./build-bin-ubuntu-latest.zip + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: build-bin-windows-latest + path: ./build-bin-windows-latest.zip + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: build-bin-macos-latest + path: ./build-bin-macos-latest.zip - name: Create Release id: create_release @@ -68,16 +91,37 @@ jobs: release_name: Release-${{ github.repository }}-${{ github.run_id }} draft: false prerelease: false - if: github.event_name == 'push' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + + - name: Upload Release Assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build-bin-ubuntu-latest.zip + asset_name: build-bin-ubuntu-latest.zip + asset_content_type: application/zip + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + + - name: Upload Release Assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build-bin-windows-latest.zip + asset_name: build-bin-windows-latest.zip + asset_content_type: application/zip + if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - name: Upload Release Asset - id: upload-release-asset + - name: Upload Release Assets uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/bin.zip - asset_name: build-bin-${{ runner.os }}.zip + asset_path: ./build-bin-macos-latest.zip + asset_name: build-bin-macos-latest.zip asset_content_type: application/zip - if: github.event_name == 'push' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' \ No newline at end of file