-
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.
Changes made: - CI properly supports being ran on PRs and shouldn't fail anymore on the RRG repo; - The nonsense of unzipping archives during release creation isn't needed anymore because now there's an artifact that holds all the files (both zip and others) that should be included in a release; - Softdevice and Application verification were re-enabled (as per @doegox suggestion); - Softdevice is now bundled in `-firmware` artifact; - `dev` release tag is now updated ad every push to main; - On PRs a comment linking to artifact is now added by CI after success, artifact links are done with nightly.link so that they also fork for unauthenticated users; There are some quirks: - on_pr runs on pull_request_target because it needs write access to packages, but pull_request_target implies that GITHUB_SHA is set to the base repo HEAD commit, so the whole `checkout-sha` thing is needed. This also implies that if one of the workflow files are changed in a PR the changed versions won't be ran against that same PR. - Client building per OS isn't yet implemented but all the necessary scaffolding is there. At the moment the per-OS clients are just a zip file containing all the client source. Examples: - PR comment: augustozanellato#14 (comment) - `dev` release: https://github.com/augustozanellato/ChameleonUltra/releases/tag/dev
- Loading branch information
1 parent
95aded8
commit 4bdbb8d
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