Build packages #127
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
| name: Build packages | |
| on: | |
| release: | |
| types: [created] | |
| # pull_request: | |
| # branches: [main] | |
| # types: [opened] | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: 'Log level' | |
| required: true | |
| default: 'info' | |
| type: choice | |
| options: | |
| - info | |
| - warning | |
| - debug | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.arch }} ${{ matrix.openwrt }} ${{ github.ref }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| openwrt: | |
| - main # APK packages going forward | |
| - openwrt-24.10 # IPK packages built using an older version | |
| arch: | |
| - x86_64 | |
| - mips_24kc | |
| - arm_cortex-a7_neon-vfpv4 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build | |
| uses: openwrt/gh-action-sdk@main | |
| env: | |
| ARCH: ${{ matrix.arch }}-${{ matrix.openwrt }} | |
| FEEDNAME: aredn | |
| EXTRA_FEEDS: "src-git|upx|https://github.com/kuoruan/openwrt-upx.git" | |
| PACKAGES: phonebook | |
| V: sc | |
| - name: Move created IPK packages to project dir | |
| if: ${{ matrix.openwrt != 'main' }} | |
| run: | | |
| cp bin/packages/${{ matrix.arch }}/aredn/phonebook*.ipk ./phonebook-${{ github.event.release.tag_name }}-${{ matrix.arch }}.ipk || true | |
| - name: Move created APK packages to project dir | |
| if: ${{ matrix.openwrt == 'main' }} | |
| run: | | |
| cp bin/packages/${{ matrix.arch }}/aredn/phonebook*.apk ./phonebook-${{ github.event.release.tag_name }}-${{ matrix.arch }}.apk || true | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.arch }}-${{ matrix.openwrt }}-package | |
| compression-level: 0 # no compression | |
| path: | | |
| *.ipk | |
| *.apk | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: ${{ github.event.release.tag_name }} | |
| tag_name: ${{ github.event.release.tag_name }} | |
| body: ${{ github.event.release.body }} | |
| prerelease: ${{ github.event.release.prerelease }} | |
| draft: ${{ github.event.release.draft }} | |
| files: | | |
| *.ipk | |
| *.apk |