Build lkms #78
This file contains hidden or 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
| # | |
| # Copyright (C) 2022 Ing <https://github.com/wjz304> | |
| # | |
| # This is free software, licensed under the MIT License. | |
| # See /LICENSE for more information. | |
| # | |
| name: Build lkms | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "format %y.%-m.$i or auto" | |
| required: false | |
| type: string | |
| prerelease: | |
| description: "pre release" | |
| default: false | |
| type: boolean | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| # - version: 6.2 | |
| # platform: apollolake | |
| # - version: 6.2 | |
| # platform: braswell | |
| # - version: 6.2 | |
| # platform: broadwell | |
| # - version: 6.2 | |
| # platform: broadwellnk | |
| # - version: 6.2 | |
| # platform: broadwellntbap | |
| # - version: 6.2 | |
| # platform: bromolow | |
| # - version: 6.2 | |
| # platform: denverton | |
| # # checkout 6.2.4 | |
| # - version: 6.2 | |
| # platform: geminilake | |
| # # checkout 6.2.4 | |
| # - version: 6.2 | |
| # platform: grantley | |
| # ## checkout 6.2.4 | |
| # ## - version: 6.2 | |
| # ## platform: kvmx64 | |
| # # checkout 6.2.4 | |
| # - version: 6.2 | |
| # platform: purley | |
| # # checkout 6.2.4 | |
| # - version: 6.2 | |
| # platform: v1000 | |
| - version: 7.1 | |
| platform: apollolake | |
| # - version: 7.1 | |
| # platform: braswell | |
| - version: 7.1 | |
| platform: broadwell | |
| - version: 7.1 | |
| platform: broadwellnk | |
| - version: 7.1 | |
| platform: broadwellnkv2 | |
| - version: 7.1 | |
| platform: broadwellntbap | |
| # - version: 7.1 | |
| # platform: bromolow | |
| - version: 7.1 | |
| platform: denverton | |
| - version: 7.1 | |
| platform: epyc7002 | |
| - version: 7.1 | |
| platform: geminilake | |
| # - version: 7.1 | |
| # platform: grantley | |
| ## - version: 7.1 | |
| ## platform: kvmx64 | |
| - version: 7.1 | |
| platform: purley | |
| - version: 7.1 | |
| platform: r1000 | |
| - version: 7.1 | |
| platform: v1000 | |
| - version: 7.2 | |
| platform: apollolake | |
| # - version: 7.2 | |
| # platform: braswell | |
| - version: 7.2 | |
| platform: broadwell | |
| - version: 7.2 | |
| platform: broadwellnk | |
| - version: 7.2 | |
| platform: broadwellnkv2 | |
| - version: 7.2 | |
| platform: broadwellntbap | |
| # - version: 7.2 | |
| # platform: bromolow | |
| - version: 7.2 | |
| platform: denverton | |
| - version: 7.2 | |
| platform: epyc7002 | |
| - version: 7.2 | |
| platform: geminilake | |
| # - version: 7.2 | |
| # platform: grantley | |
| ## - version: 7.2 | |
| ## platform: kvmx64 | |
| - version: 7.2 | |
| platform: purley | |
| - version: 7.2 | |
| platform: r1000 | |
| - version: 7.2 | |
| platform: v1000 | |
| - version: 7.2 | |
| platform: geminilakenk | |
| - version: 7.2 | |
| platform: r1000nk | |
| - version: 7.2 | |
| platform: v1000nk | |
| - version: 7.3 | |
| platform: epyc7002 | |
| - version: 7.3 | |
| platform: geminilakenk | |
| - version: 7.3 | |
| platform: r1000nk | |
| - version: 7.3 | |
| platform: v1000nk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| with: | |
| repository: RROrg/rr-lkms | |
| token: ${{ secrets.RRORG }} | |
| path: rr-lkms | |
| - name: Init Env | |
| run: | | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| sudo timedatectl set-timezone "Asia/Shanghai" | |
| - name: Make lkms | |
| run: | | |
| ROOT_PATH=${{ github.workspace }} | |
| VERSION=${{ matrix.version }} | |
| PLATFORM=${{ matrix.platform }} | |
| . ${ROOT_PATH}/rr-lkms/compile.sh | |
| echo "makeEnvDeploy" | |
| TOKEN="${{ secrets.RRORG }}" makeEnvDeploy "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" | |
| echo "makemodules" | |
| makelkms "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "${ROOT_PATH}/rr-lkms" "${ROOT_PATH}/output" | |
| - name: Upload to Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rp-lkms-${{ matrix.version }}-${{ matrix.platform }} | |
| path: | | |
| output/* | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: Init Env | |
| run: | | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| sudo timedatectl set-timezone "Asia/Shanghai" | |
| - name: Calculate version | |
| run: | | |
| # Calculate version | |
| VERSION="" | |
| if [ -n "${{ inputs.version }}" ]; then | |
| if [ "$(echo ${{ inputs.version }} | cut -d '.' -f 1,2)" = "$(date +'%y.%-m')" ]; then | |
| VERSION="${{ inputs.version }}" | |
| else | |
| LATEST_TAG="$(curl -skLH "Authorization: token ${{ secrets.RRORG }}" "https://api.github.com/repos/RROrg/rr-lkms/releases" | jq -r ".[0].tag_name" 2>/dev/null)" | |
| if [ -n "${LATEST_TAG}" ] && [ "$(echo ${LATEST_TAG} | cut -d '.' -f 1,2)" = "$(date +'%y.%-m')" ]; then # format %y.%-m.$i | |
| VERSION="$(echo ${LATEST_TAG} | awk -F '.' '{$3=$3+1}1' OFS='.')" | |
| else | |
| VERSION="$(date +'%y.%-m').0" | |
| fi | |
| fi | |
| fi | |
| echo "VERSION: ${VERSION}" | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| - name: download to artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: output | |
| pattern: rp-lkms-* | |
| merge-multiple: true | |
| - name: delete-artifact | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: | | |
| rp-lkms-* | |
| - name: Zip lkms | |
| run: | | |
| VERSION="${{ env.VERSION }}" | |
| VERSION="${VERSION:-"test"}" | |
| echo "${VERSION}" > "output/VERSION" | |
| zip -9 rp-lkms-${VERSION}.zip -j output/* | |
| - name: Upload to Artifacts | |
| if: success() && env.VERSION == '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rp-lkms | |
| path: | | |
| rp-lkms*.zip | |
| retention-days: 5 | |
| - name: Release | |
| if: success() && env.VERSION != '' | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ env.VERSION }} | |
| prerelease: ${{ inputs.prerelease }} | |
| artifacts: rp-lkms*.zip | |
| owner: RROrg | |
| repo: rr-lkms | |
| token: ${{ secrets.RRORG }} |