Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rootfs release support #19

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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