Compile and release #91
Workflow file for this run
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
name: Compile and release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
# Only publish on tags. run git tag vX and git push origin vX | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
strategy: | |
matrix: | |
target: [armel, mipsel, mipseb] | |
steps: | |
- name: Install git | |
run: sudo apt-get -qq update -y && sudo apt-get -qq install git -y | |
- uses: actions/checkout@v4 # Clones to $GITHUB_WORKSPACE | |
with: | |
fetch-depth: 0 | |
#submodules: 'true' | |
# Instead of getting submodules with checkout, we can do it manually to control depth. | |
# We don't want a full Linux history | |
- name: Pull kernel source | |
run: git submodule update --init --depth 1 | |
- name: Build Kernel for ${{ matrix.target }} | |
run: ./build.sh --targets ${{ matrix.target }} | |
# Temporarily store each target's build output | |
- name: Save ${{ matrix.target }} build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-output-${{ matrix.target }} | |
path: kernels-latest.tar.gz | |
aggregate: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
steps: | |
- name: Download all build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: downloaded-kernels | |
- name: debug | |
run: find downloaded-kernels | |
- name: Combine all kernels into a single archive | |
run: | | |
mkdir combined-kernels | |
# Extract each kernels-latest.tar.gz archive | |
for archive in $(find downloaded-kernels -name "*.tar.gz"); do | |
tar -xzf "$archive" -C combined-kernels | |
done | |
# Create a new single archive from the combined content | |
tar -czvf kernels-latest.tar.gz -C combined-kernels . | |
- name: Upload the final archive | |
uses: actions/upload-artifact@v3 | |
with: | |
name: kernels-latest.tar.gz | |
path: kernels-latest.tar.gz | |
release: | |
needs: aggregate | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: read | |
steps: | |
- name: Download the final kernels archive | |
uses: actions/download-artifact@v3 | |
with: | |
name: kernels-latest.tar.gz | |
- name: Create and publish release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: kernels-latest.tar.gz | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ github.ref }} |