Skip to content

Commit

Permalink
Handle linux/windows artifacts & release
Browse files Browse the repository at this point in the history
  • Loading branch information
jordantgh committed Oct 3, 2023
1 parent 431e243 commit 2cf7843
Showing 1 changed file with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,57 @@ jobs:
if: runner.os == 'Windows'
run: Compress-Archive -Path .\dist\${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}.exe -DestinationPath .\${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_windows.zip

# Upload the packaged binary as an artifact
- name: Upload Binary as Artifact
# Upload the packaged binary as an artifact for Linux
- name: Upload Linux Binary as Artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-binary
name: linux-binary
path: '*.tar.gz'

# Upload the packaged binary as an artifact for Windows
- name: Upload Windows Binary as Artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: windows-binary
path: '*.zip'

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download all compiled artifacts
uses: actions/download-artifact@v2

- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First release
- Not feature complete! Just a basic scaffold
draft: true
prerelease: true

- name: Upload Release Asset for Linux
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Linux-binary/${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_linux.tar.gz
asset_name: ${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_linux.tar.gz
asset_content_type: application/gzip

- name: Upload Release Asset for Windows
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Windows-binary/${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_windows.zip
asset_name: ${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_windows.zip
asset_content_type: application/zip

0 comments on commit 2cf7843

Please sign in to comment.