-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from augustozanellato/refactor_ci
CI refactor
- Loading branch information
Showing
8 changed files
with
188 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# This is just a placeholder while the whole PyInstaller thing gets figured out | ||
name: Client build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
checkout-sha: | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
build_client: | ||
name: Build client | ||
strategy: | ||
matrix: | ||
include: | ||
- name: windows | ||
os: windows-latest | ||
pre_command: | | ||
? . | ||
bundle_command: | | ||
Compress-Archive -Path software\* -DestinationPath client-windows.zip | ||
- name: linux | ||
os: ubuntu-latest | ||
pre_command: | | ||
true | ||
bundle_command: | | ||
(cd software && zip -r "$OLDPWD/client-linux.zip" .) | ||
- name: macos | ||
os: macos-latest | ||
pre_command: | | ||
true | ||
bundle_command: | | ||
(cd software && zip -r "$OLDPWD/client-macos.zip" .) | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.checkout-sha == null && github.sha || inputs.checkout-sha }} | ||
- name: Run OS specific setup | ||
run: ${{ matrix.pre_command }} | ||
- name: Upload built client | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: client-${{ matrix.name }} | ||
path: software/* | ||
- name: Zip up client for release | ||
run: ${{ matrix.bundle_command }} | ||
- name: Upload release artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-artifacts | ||
path: client-${{ matrix.name }}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: PR handler | ||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
firmware_pipeline: | ||
name: Build Firmware | ||
permissions: | ||
packages: write | ||
contents: read | ||
uses: ./.github/workflows/build_firmware.yml | ||
with: | ||
checkout-sha: "${{ github.event.pull_request.merge_commit_sha }}" | ||
client_pipeline: | ||
name: Build Firmware | ||
uses: ./.github/workflows/build_client.yml | ||
with: | ||
checkout-sha: "${{ github.event.pull_request.merge_commit_sha }}" | ||
comment: | ||
runs-on: ubuntu-latest | ||
name: Comment on PR | ||
needs: | ||
- firmware_pipeline | ||
- client_pipeline | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
message: | | ||
# Built artifacts for commit ${{ github.event.pull_request.head.sha }} | ||
## Firmware | ||
- [Ultra APP DFU Package](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/ultra-dfu-app.zip) | ||
- [Ultra binaries](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/ultra-firmware.zip) | ||
- [Lite APP DFU Package](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/lite-dfu-app.zip) | ||
- [Lite binaries](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/lite-firmware.zip) | ||
## Client | ||
- [Linux](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/client-linux.zip) | ||
- [macOS](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/client-macos.zip) | ||
- [Windows](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/client-windows.zip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Push handler | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
firmware_pipeline: | ||
name: Build Firmware | ||
permissions: | ||
packages: write | ||
contents: read | ||
uses: ./.github/workflows/build_firmware.yml | ||
client_pipeline: | ||
name: Build Firmware | ||
uses: ./.github/workflows/build_client.yml | ||
create_release: | ||
permissions: | ||
contents: write | ||
name: Create dev pre-release with artifacts | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
needs: | ||
- firmware_pipeline | ||
- client_pipeline | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: Download release artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: release-artifacts | ||
path: release-artifacts | ||
- name: Upload to dev release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: | | ||
Auto-Generated DFU packages from latest `main` commit. | ||
For development purposes only. | ||
These are not tested, here be dragons. | ||
Built from commit ${{ github.sha }} | ||
tag_name: dev | ||
name: Development release | ||
draft: false | ||
prerelease: true | ||
target_commitish: ${{ github.sha }} | ||
generate_release_notes: true | ||
files: release-artifacts/* | ||
- name: Fix up release tag | ||
run: | | ||
git tag -f dev | ||
git push --tags -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters