-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build and push full release in CI on [upload] (#288)
* push to ci-artifacts and pr comment ifs [upload] * [upload] * update permissions * [upload] * splitted build and push-and-upload workflows * [upload]
- Loading branch information
1 parent
6d886f2
commit f125aee
Showing
2 changed files
with
80 additions
and
30 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
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,68 @@ | ||
name: push and comment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["build"] | ||
types: | ||
- completed | ||
|
||
env: | ||
BUILD_JOB_NAME: "build kernel and system" | ||
|
||
jobs: | ||
preview: | ||
name: push and comment | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Get workflow run ID | ||
id: get_run_id | ||
run: | | ||
echo "run_id=$(curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs | jq -r '.check_runs[] | select(.name == "${{ env.BUILD_JOB_NAME }}") | .html_url | capture("(?<number>[0-9]+)") | .number')" >> $GITHUB_OUTPUT | ||
- name: Checkout ci-artifacts | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: commaai/ci-artifacts | ||
ssh-key: ${{ secrets.CI_ARTIFACTS_DEPLOY_KEY }} | ||
path: ${{ github.workspace }}/ci-artifacts | ||
ref: master | ||
|
||
- name: Download artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v6 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
run_id: ${{ steps.get_run_id.outputs.run_id }} | ||
search_artifacts: true | ||
name: agnos-artifacts-${{ github.event.number }} | ||
path: ${{ github.workspace }}/ci-artifacts | ||
|
||
- name: Push boot, system and agnos.json | ||
working-directory: ${{ github.workspace }}/ci-artifacts | ||
run: | | ||
mv ota.json agnos.json | ||
git checkout -b agnos-builder/pr-${{ github.event.number }} | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
git add . | ||
git commit -m "build artifacts for PR #${{ github.event.number }}" | ||
git push origin agnos-builder/pr-${{ github.event.number }} --force | ||
- name: Comment on PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: | | ||
<!-- _(run_id **${{ github.run_id }}**)_ --> | ||
## Build agnos.json | ||
Download <a href="https://raw.githubusercontent.com/commaai/ci-artifacts/agnos-builder/pr-${{ github.event.number }}/agnos.json" target="_blank">agnos.json</a> and replace `openpilot/system/hardware/tici/agnos.json` in your openpilot branch. | ||
If you need to flash locally, you can download the <a href="https://github.com/commaai/ci-artifacts/tree/agnos-builder/pr-${{ github.event.number }}" target="_blank">images</a> and unarchive them in `agnos-builder/output` and flash with `./flash_all.sh`. | ||
--- | ||
comment_tag: run_id | ||
pr_number: ${{ github.event.number }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |