build(nix): update dependencies #101
This file contains 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: wit-deps | |
on: | |
pull_request: | |
push: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-bin: | |
strategy: | |
matrix: | |
config: | |
- target: aarch64-unknown-linux-musl | |
install-path: /bin/wit-deps | |
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/wit-deps --version | |
test-oci: docker load < ./result | |
# TODO: Run aarch64 binary within OCI | |
- target: aarch64-apple-darwin | |
install-path: /bin/wit-deps | |
test-bin: file ./result/bin/wit-deps | |
test-oci: docker load < ./result | |
- target: armv7-unknown-linux-musleabihf | |
install-path: /bin/wit-deps | |
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-arm ./result/bin/wit-deps --version | |
test-oci: docker load < ./result | |
# TODO: Run armv7 binary within OCI | |
- target: x86_64-apple-darwin | |
install-path: /bin/wit-deps | |
test-bin: file ./result/bin/wit-deps | |
test-oci: docker load < ./result | |
- target: x86_64-pc-windows-gnu | |
install-path: /bin/wit-deps.exe | |
test-bin: nix shell --inputs-from . 'nixpkgs#wine64' -c wine64 ./result/bin/wit-deps.exe --version | |
test-oci: docker load < ./result | |
# TODO: Run windows binary within OCI | |
- target: x86_64-unknown-linux-musl | |
install-path: /bin/wit-deps | |
test-bin: ./result/bin/wit-deps --version | |
test-oci: | | |
docker load < ./result | |
docker run --rm wit-deps:$(nix eval --raw .#wit-deps-x86_64-unknown-linux-musl-oci.imageTag) wit-deps --version | |
name: wit-deps-${{ matrix.config.target }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/install-nix | |
with: | |
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- uses: ./.github/actions/build-nix | |
with: | |
package: wit-deps-${{ matrix.config.target }} | |
install-path: ${{ matrix.config.install-path }} | |
- run: ${{ matrix.config.test-bin }} | |
- uses: ./.github/actions/build-nix | |
with: | |
package: wit-deps-${{ matrix.config.target }}-oci | |
- run: ${{ matrix.config.test-oci }} | |
build-lipo: | |
name: wit-deps-universal-darwin | |
needs: build-bin | |
runs-on: macos-12 | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-aarch64-apple-darwin | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-apple-darwin | |
- run: chmod +x ./wit-deps-x86_64-apple-darwin | |
- run: ./wit-deps-x86_64-apple-darwin --version | |
- run: lipo -create ./wit-deps-aarch64-apple-darwin ./wit-deps-x86_64-apple-darwin -output ./wit-deps-universal-darwin | |
- run: chmod +x ./wit-deps-universal-darwin | |
- run: ./wit-deps-universal-darwin --version | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wit-deps-universal-darwin | |
path: wit-deps-universal-darwin | |
cargo: | |
strategy: | |
matrix: | |
check: | |
- audit | |
- fmt | |
- clippy | |
- nextest | |
name: cargo ${{ matrix.check }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/install-nix | |
with: | |
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix build -L .#checks.x86_64-linux.${{ matrix.check }} | |
build-doc: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/install-nix | |
with: | |
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix build -L .#checks.x86_64-linux.doc | |
- run: tar xf ./result/target.tar.zst | |
- run: rm -f target/doc/.lock | |
- name: Create `.nojekyll` | |
run: touch target/doc/.nojekyll | |
- name: Write `index.html` | |
run: | | |
cat <<EOF > target/doc/index.html | |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Redirecting to wit_deps/index.html</title> | |
<meta http-equiv="refresh" content="0; URL=wit_deps/index.html"> | |
<link rel="canonical" href="https://${{ github.repository.owner }}.github.io/wit-deps/wit_deps/index.html"> | |
EOF | |
- uses: actions/[email protected] | |
with: | |
path: target/doc | |
deploy-doc: | |
runs-on: ubuntu-22.04 | |
needs: build-doc | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/[email protected] | |
id: deployment | |
release: | |
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' | |
needs: [ build-bin, build-lipo, build-doc, cargo ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-aarch64-apple-darwin | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-aarch64-unknown-linux-musl | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-armv7-unknown-linux-musleabihf | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-universal-darwin | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-apple-darwin | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-pc-windows-gnu | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-unknown-linux-musl | |
- run: chmod +x ./wit-deps-* | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-aarch64-apple-darwin-oci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-aarch64-unknown-linux-musl-oci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-armv7-unknown-linux-musleabihf-oci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-pc-windows-gnu-oci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-apple-darwin-oci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wit-deps-x86_64-unknown-linux-musl-oci | |
- uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: true | |
generate_release_notes: true | |
files: | | |
wit-deps-aarch64-apple-darwin | |
wit-deps-aarch64-apple-darwin-oci | |
wit-deps-aarch64-unknown-linux-musl | |
wit-deps-aarch64-unknown-linux-musl-oci | |
wit-deps-armv7-unknown-linux-musleabihf | |
wit-deps-armv7-unknown-linux-musleabihf-oci | |
wit-deps-universal-darwin | |
wit-deps-x86_64-apple-darwin | |
wit-deps-x86_64-apple-darwin-oci | |
wit-deps-x86_64-pc-windows-gnu | |
wit-deps-x86_64-pc-windows-gnu-oci | |
wit-deps-x86_64-unknown-linux-musl | |
wit-deps-x86_64-unknown-linux-musl-oci |