-
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.
fixed build and push full release in CI (#305)
* fixed ci workflows * don't push ota-staging.json and system-skip-chunks-*.img.xz * add back permissions * updated raw links * fixed missing if * switch to gitlab * VERSION
- Loading branch information
1 parent
f125aee
commit 7f7a7a7
Showing
4 changed files
with
64 additions
and
52 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 |
---|---|---|
|
@@ -6,63 +6,82 @@ on: | |
types: | ||
- completed | ||
|
||
env: | ||
BUILD_JOB_NAME: "build kernel and system" | ||
|
||
jobs: | ||
preview: | ||
name: push and comment | ||
push-and-comment: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
timeout-minutes: 15 | ||
timeout-minutes: 5 | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
actions: read | ||
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: Setup SSH key | ||
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 | ||
with: | ||
ssh-private-key: ${{ secrets.CI_ARTIFACTS_GITLAB_DEPLOY_KEY }} | ||
|
||
- 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 | ||
run: | | ||
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts | ||
git clone -b main [email protected]:commaai/ci-artifacts.git ${{ github.workspace }}/ci-artifacts | ||
- name: Download artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v6 | ||
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
run_id: ${{ steps.get_run_id.outputs.run_id }} | ||
search_artifacts: true | ||
name: agnos-artifacts-${{ github.event.number }} | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: agnos-artifacts | ||
path: ${{ github.workspace }}/ci-artifacts | ||
|
||
- name: Read PR number and VERSION | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const prNumber = fs.readFileSync('${{ github.workspace }}/ci-artifacts/PR', 'utf8').trim(); | ||
core.exportVariable('PR_NUMBER', prNumber); | ||
const version = fs.readFileSync('${{ github.workspace }}/ci-artifacts/VERSION', 'utf8').trim(); | ||
core.exportVariable('VERSION', version); | ||
- 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 }} | ||
mv ota.json agnos.json && rm ota-staging.json system-skip-chunks-*.img.xz | ||
git checkout -b agnos-builder/pr-${{ env.PR_NUMBER }} | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
git lfs track "*.xz" | ||
git add . | ||
git commit -m "build artifacts for PR #${{ github.event.number }}" | ||
git push origin agnos-builder/pr-${{ github.event.number }} --force | ||
git commit -m "build artifacts for PR #${{ env.PR_NUMBER }}" | ||
git push origin agnos-builder/pr-${{ env.PR_NUMBER }} --force | ||
- name: List .xz files with links | ||
id: list_xz | ||
working-directory: ${{ github.workspace }}/ci-artifacts | ||
run: | | ||
{ | ||
echo 'XZ_FILES<<EOF' | ||
for file in *.xz; do | ||
echo "* [$file](https://gitlab.com/commaai/ci-artifacts/-/raw/agnos-builder/pr-${{ env.PR_NUMBER }}/$file)" | ||
done | ||
echo EOF | ||
} >> $GITHUB_ENV | ||
- name: Comment on PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 | ||
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. | ||
<!-- _(run_id **${{ github.event.workflow_run.id }}**)_ --> | ||
## :white_check_mark: AGNOS update ${{ env.VERSION }} ready | ||
In an openpilot branch, download <a href="https://gitlab.com/commaai/ci-artifacts/-/raw/agnos-builder/pr-${{ env.PR_NUMBER }}/agnos.json">agnos.json</a> in `system/hardware/tici/` and update `AGNOS_VERSION` to **${{ env.VERSION }}** in `launch_env.sh`. | ||
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`. | ||
For flashing locally, download and unarchive the images in `agnos-builder/output` and flash with `./flash_all.sh`. | ||
--- | ||
### Images: | ||
${{ env.XZ_FILES }} | ||
pr_number: ${{ env.PR_NUMBER }} | ||
comment_tag: run_id | ||
pr_number: ${{ github.event.number }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
mode: recreate |
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 @@ | ||
10.1 |