Skip to content

Commit

Permalink
fixup! ci: utilize cache for SDK and Imagebuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
blocktrron committed Jul 28, 2024
1 parent e540f15 commit a5f56ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@ jobs:
${{ steps.build-metadata.outputs.imagebuilder-name }}
imagebuilder-url:
${{ steps.build-metadata.outputs.imagebuilder-url }}
cache-key:
${{ steps.cache-key.outputs.cache-key }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
submodules: true
- name: Determine Version
id: build-metadata
run: bash $GITHUB_WORKSPACE/contrib/get-version.sh
- name: Determine Cache-Key
id: cache-key
run: >
echo "cache-key=$(bash $GITHUB_WORKSPACE/contrib/cache-key.sh
$GITHUB_WORKSPACE ${{ steps.build-metadata.outputs.sdk-url }})" >> "$GITHUB_OUTPUT"
- name: Create Artifact of build-meta
uses: actions/upload-artifact@v4
with:
Expand All @@ -50,8 +58,7 @@ jobs:
- name: Determine Cache-Key
id: cache-key-sdk
run: >
echo "cache-key=$(bash $GITHUB_WORKSPACE/contrib/cache-key.sh
$GITHUB_WORKSPACE ${{ needs.build-meta.outputs.sdk-url }})" >> "$GITHUB_OUTPUT"
echo "cache-key=sdk-${{ needs.build-meta.outputs.sdk-url }})" >> "$GITHUB_OUTPUT"
- name: Restore Cache
id: restore-cache-sdk
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -125,16 +132,32 @@ jobs:
- name: Show binary output directory structure
run: |
tree /tmp/packages
- name: Determine Cache-Key
id: cache-key-ib
run: >
echo "cache-key=ib-${{ needs.build-meta.outputs.sdk-url }})" >> "$GITHUB_OUTPUT"
- name: Install dependencies
run: |
$GITHUB_WORKSPACE/contrib/install-deps.sh
- name: Restore Cache
id: restore-cache-ib
uses: actions/cache/restore@v4
with:
path: /tmp/openwrt-imagebuilder
key: ${{ steps.cache-key-ib.outputs.cache-key }}
- name: Download Imagebuilder
run: |
curl -o /tmp/openwrt-imagebuilder.tar.xz ${{ needs.build-meta.outputs.imagebuilder-url }}
- name: Extract Imagebuilder
run: |
tar -xf /tmp/openwrt-imagebuilder.tar.xz -C /tmp
mv /tmp/${{ needs.build-meta.outputs.imagebuilder-name }} /tmp/openwrt-imagebuilder
- name: Save cache
id: save-cache-ib
uses: actions/cache/save@v4
with:
path: /tmp/openwrt-imagebuilder
key: ${{ steps.cache-key-ib.outputs.cache-key }}
- name: Link repositories
run: |
sed -i '/^option check_signature/d' /tmp/openwrt-imagebuilder/repositories.conf
Expand Down
File renamed without changes.

0 comments on commit a5f56ae

Please sign in to comment.