fix: tools/runimage for windows machine #2069
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 And Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| env: | |
| SOURCE_DATE_EPOCH: 1700000000 | |
| RELEASE: 1 | |
| jobs: | |
| build: | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install requirements | |
| run: sudo apt-get update -y && sudo apt-get install -y parted zip | |
| - name: Cleanup cache | |
| run: rm -rf _cache | |
| - name: Build | |
| run: | | |
| PATH=$PATH:/usr/sbin make GOARCH=${{matrix.arch}} -j$(nproc) | |
| - name: Compress Image | |
| run: | | |
| rm -rf _cache/${{matrix.arch}}/bundle | |
| mkdir -p _cache/${{matrix.arch}}/bundle | |
| cp -a _cache/${{matrix.arch}}/disk.img external/${{matrix.arch}}/firmware external/${{matrix.arch}}/variables _cache/${{matrix.arch}}/bundle/ | |
| cd _cache/${{matrix.arch}}/bundle | |
| zip ../avyos-${{github.ref_name}}-${{matrix.arch}}.zip disk.img firmware variables | |
| - name: Create / Update Release and Upload Artifact | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| tag_name: ${{ github.ref_name }} | |
| prerelease: ${{ github.ref_type != 'tag' }} | |
| allowUpdates: true | |
| files: | | |
| _cache/${{matrix.arch}}/avyos-${{github.ref_name}}-${{matrix.arch}}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |