wip: initial attempt to build UKI #75
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: release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| github: | |
| runs-on: ubuntu-24.04 | |
| if: "contains(github.event.head_commit.message, 'chore: release')" | |
| steps: | |
| - run: sudo apt-get update && sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev libudev-dev libgtk-4-dev libglib2.0-dev | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: MarcoIeni/[email protected] | |
| with: | |
| command: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| linux: | |
| name: linux / ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| needs: github | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - aarch64-unknown-linux-gnu | |
| - aarch64-unknown-linux-musl | |
| - i686-unknown-linux-gnu | |
| - x86_64-unknown-linux-gnu | |
| - x86_64-unknown-linux-musl | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --release --target ${{ matrix.target }} --exclude goldboot-uki | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: goldboot-${{ matrix.target }} | |
| path: target/${{ matrix.target }}/release/goldboot | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: goldboot-registry-${{ matrix.target }} | |
| path: target/${{ matrix.target }}/release/goldboot-registry | |
| - name: Upload artifacts to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| for tag in $(git tag --points-at HEAD); do | |
| if cp target/${{ matrix.target }}/release/${tag%-*} ${tag%-*}_${{ matrix.target }}; then | |
| gh release upload "${tag}" "${tag%-*}_${{ matrix.target }}" | |
| fi | |
| done | |
| goldboot-uki: | |
| runs-on: ubuntu-24.04 | |
| needs: linux | |
| steps: | |
| - run: sudo apt-get update && sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev libudev-dev libgtk-4-dev libglib2.0-dev | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| override: true | |
| - uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --release | |
| - name: Build goldboot-uki image x86_64 | |
| run: | | |
| export RUST_BACKTRACE=1 | |
| export RUST_LOG=debug | |
| target/release/goldboot init --os Goldboot --executable target/release/goldboot-uki | |
| target/release/goldboot cast --output goldboot-uki-x86_64.gb . | |
| - name: Upload artifacts to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| for tag in $(git tag --points-at HEAD); do | |
| if [ "${tag%-*}" = "goldboot-uki" ]; then | |
| mv target/release/${tag%-*} "${tag%-*}_x86_64-unknown-linux-gnu" | |
| gh release upload "${tag}" "${tag%-*}_x86_64-unknown-linux-gnu" | |
| mv goldboot-uki-x86_64.gb "${tag%-*}_x86_64-unknown-linux-gnu.gb" | |
| gh release upload "${tag}" "${tag%-*}_x86_64-unknown-linux-gnu.gb" | |
| fi | |
| done | |
| macos: | |
| runs-on: macos-latest | |
| needs: github | |
| steps: | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| override: true | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --release --exclude goldboot-uki | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: goldboot-x86_64-apple-darwin | |
| path: target/release/goldboot | |
| - name: Upload artifacts to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| for tag in $(git tag --points-at HEAD); do | |
| if cp target/release/${tag%-*} ${tag%-*}_x86_64-apple-darwin; then | |
| gh release upload "${tag}" "${tag%-*}_x86_64-apple-darwin" | |
| fi | |
| done | |
| windows: | |
| runs-on: windows-latest | |
| needs: github | |
| steps: | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| override: true | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --release --exclude goldboot-uki | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: goldboot-x86_64-pc-windows-msvc | |
| path: target/release/goldboot | |
| - name: Upload artifacts to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| foreach ($tag in $(git tag --points-at HEAD)) { | |
| $tagWithoutSuffix = $tag -replace '-.*$' | |
| if (Copy-Item -Path "target\release\$tagWithoutSuffix" -Destination "$tagWithoutSuffix_x86_64-pc-windows-msvc") { | |
| gh release upload $tag "$tagWithoutSuffix_x86_64-pc-windows-msvc" | |
| } | |
| } | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: linux | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: goldboot-x86_64-unknown-linux-musl | |
| path: goldboot/linux-amd64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: goldboot-aarch64-unknown-linux-musl | |
| path: goldboot/linux-arm64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: goldboot-registry-x86_64-unknown-linux-musl | |
| path: goldboot/linux-amd64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: goldboot-registry-aarch64-unknown-linux-musl | |
| path: goldboot/linux-arm64 | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Find version tags | |
| id: get_tags | |
| run: | | |
| for tag in $(git tag --points-at HEAD); do | |
| echo "${tag%-*}=${tag##*-}" >>"$GITHUB_OUTPUT" | |
| done | |
| - uses: docker/build-push-action@v5 | |
| if: ${{ steps.get_tags.outputs.goldboot != '' }} | |
| with: | |
| context: goldboot | |
| platforms: linux/amd64,linux/arm64 #,linux/arm/v7 | |
| push: true | |
| tags: fossable/goldboot:latest,fossable/goldboot:${{ steps.get_tags.outputs.goldboot }} | |
| - uses: docker/build-push-action@v5 | |
| if: ${{ steps.get_tags.outputs.goldboot-registry != '' }} | |
| with: | |
| context: goldboot-registry | |
| platforms: linux/amd64,linux/arm64 #,linux/arm/v7 | |
| push: true | |
| tags: fossable/goldboot-registry:latest,fossable/goldboot-registry:${{ steps.get_tags.outputs.goldboot-registry }} | |
| - uses: peter-evans/dockerhub-description@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: fossable/goldboot |