diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d6a85ea --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,62 @@ +# +# Copyright (C) 2022 Ing +# +# This is free software, licensed under the MIT License. +# See /LICENSE for more information. +# + + +name: Build +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + platform: [apollolake, broadwell, broadwellnk, denverton, geminilake, v1000] + + 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" + echo "release_tag=$(date +"%Y.%m.%d-%H%M")" >> $GITHUB_ENV + + - name: Build igc for ${{matrix.platform}} + run : | + mkdir ./${{matrix.platform}} && chmod 777 ./${{matrix.platform}} + sudo docker run -u 1000 --rm -t -v "${PWD}":/input -v "${PWD}/${{matrix.platform}}":/output fbelavenuto/syno-compiler compile-module ${{matrix.platform}} + + ls -al ${PWD}/${{matrix.platform}} + tar zcvf igc-${{matrix.platform}}.tgz -C./${{matrix.platform}}/ . + + - name: Upload firmware to release + uses: softprops/action-gh-release@v1 + if: (!cancelled()) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.release_tag }} + files: ./igc*.tgz + + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + retain_days: 1 + keep_minimum_runs: 9 + + - name: Remove old Releases + uses: dev-drprasad/delete-older-releases@v0.1.0 + with: + keep_latest: 9 + delete_tags: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +