Skip to content

Commit

Permalink
CI: publish executables in releases
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 50f8edc
Author: Quentin Gliech <[email protected]>
Date:   Sat Sep 26 15:03:26 2020 +0200

    CI: fix syntax

commit 0e07fc6
Author: Quentin Gliech <[email protected]>
Date:   Sat Sep 26 15:00:08 2020 +0200

    CI: upload artifacts on new releases

commit a6959df
Author: Quentin Gliech <[email protected]>
Date:   Sat Sep 26 14:43:46 2020 +0200

    CI: fix archive path

commit 61bda24
Author: Quentin Gliech <[email protected]>
Date:   Sat Sep 26 14:38:22 2020 +0200

    fix step IDs

commit 206f643
Author: Quentin Gliech <[email protected]>
Date:   Sat Sep 26 14:36:30 2020 +0200

    WIP: publish executables in releases
  • Loading branch information
sandhose committed Sep 26, 2020
1 parent d00ff6a commit acac687
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
on: [push, pull_request]
on:
push:
pull_request:
release:
types:
- created

name: Compile

Expand Down Expand Up @@ -44,3 +49,59 @@ jobs:
with:
name: z33-emulator-${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ matrix.exe }}

publish:
name: Publish draft release
needs: [build]
runs-on: ubuntu-20.04
if: github.event_name == 'release'

steps:
- uses: actions/download-artifact@v2
with:
path: artifacts

- name: Fix permissions (x86_64-apple-darwin)
run: chmod +x artifacts/z33-emulator-x86_64-apple-darwin/z33-emulator

- name: Fix permissions (x86_64-unknown-linux-musl)
run: chmod +x artifacts/z33-emulator-x86_64-unknown-linux-musl/z33-emulator

- name: Create darwin archive
run: tar -czvf z33-emulator-x86_64-apple-darwin.tar.gz --owner=0 --group=0 -C artifacts/z33-emulator-x86_64-apple-darwin/ z33-emulator

- name: Create linux archive
run: tar -czvf z33-emulator-x86_64-unknown-linux-musl.tar.gz --owner=0 --group=0 -C artifacts/z33-emulator-x86_64-unknown-linux-musl/ z33-emulator

- name: Upload darwin archive
id: upload-darwin-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./z33-emulator-x86_64-apple-darwin.tar.gz
asset_name: z33-emulator-x86_64-apple-darwin.tar.gz
asset_content_type: application/tar+gzip

- name: Upload linux archive
id: upload-linux-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./z33-emulator-x86_64-unknown-linux-musl.tar.gz
asset_name: z33-emulator-x86_64-unknown-linux-musl.tar.gz
asset_content_type: application/tar+gzip

- name: Upload windows executable
id: upload-windows-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./artifacts/z33-emulator-x86_64-pc-windows-msvc/z33-emulator.exe
asset_name: z33-emulator-x86_64-pc-windows-msvc.exe
asset_content_type: application/vnd.microsoft.portable-executable

0 comments on commit acac687

Please sign in to comment.