Skip to content

Commit

Permalink
Add rootfs release support (#19)
Browse files Browse the repository at this point in the history
* Add rootfs release support

Implemented handler for rootfs release type.

* Self-test: make rootfs release job depend on zip_archive release job

This is to avoid a potential race condition related to manifest
anti-rollback version setting.
  • Loading branch information
syncom authored May 21, 2024
1 parent f9b7338 commit f277a02
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,32 @@ jobs:
signing_key_management: 'local'
signing_key: ${{ secrets.TEST_SIGNING_KEY }}
signing_key_password: ${{ secrets.TEST_SIGNING_KEY_PASSWORD }}

test_ota_release_rootfs:
name: 'Test OTA Release Action (release_type: rootfs)'
needs: 'test_ota_release_zip_archive'
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v4'

- name: 'Set up environment'
run: |
echo "TIMESTAMP=$(date +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_ENV
- name: 'Create (bogus) rootfs for test'
run: |
echo "Create fake rootfs at ${{ env.TIMESTAMP }}" > rootfs.img
- name: 'Test OTA Release'
uses: './' # Use an action in the root directory
with:
release_name: 'rootfs-release ${{ env.TIMESTAMP }}'
release_type: 'rootfs'
persist_dir: '/tmp/persist'
rootfs_img_path: 'rootfs.img'
base_install_path_on_device: '/boot'
project_access_token: ${{ secrets.TEST_PROJECT_ACCESS_TOKEN }}
signing_key_management: 'local'
signing_key: ${{ secrets.TEST_SIGNING_KEY }}
signing_key_password: ${{ secrets.TEST_SIGNING_KEY_PASSWORD }}
20 changes: 17 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,22 @@ file_release() {
}

rootfs_release() {
echo "Not implemented"
exit 1
get_manifest_template_hack

local release_name="${INPUT_RELEASE_NAME:-}"

local rootfs_img_path="${INPUT_ROOTFS_IMG_PATH:-}"
[ -z "${rootfs_img_path}" ] && err "No rootfs image path provided"

"${TRH_BINARY_PATH}" prepare --target="${rootfs_img_path}"

if [ -n "${release_name}" ]; then
"${TRH_BINARY_PATH}" release --name="${release_name}"
else
"${TRH_BINARY_PATH}" release
fi

echo "done"
}

zip_archive_release() {
Expand All @@ -98,7 +112,7 @@ zip_archive_release() {
"${TRH_BINARY_PATH}" release --name="${release_name}"
else
"${TRH_BINARY_PATH}" release
fi
fi

echo "done"
}
Expand Down

0 comments on commit f277a02

Please sign in to comment.