From 060db7a472df5db824f5ca7fc15a315254c68e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Thu, 10 Oct 2024 09:30:16 +0200 Subject: [PATCH] fix workflows bin name --- .github/workflows/pre-release.yml | 8 +-- .github/workflows/release.yml | 108 ++++++------------------------ 2 files changed, 24 insertions(+), 92 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 8137961..c6e098f 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -42,10 +42,10 @@ jobs: - name: Upload release artifact (tarball) uses: actions/upload-artifact@v4 with: - name: "himalaya.${{ matrix.target }}.tgz" - path: result/himalaya.tgz + name: "himalaya-repl.${{ matrix.target }}.tgz" + path: result/himalaya-repl.tgz - name: Upload release artifact (zip) uses: actions/upload-artifact@v4 with: - name: "himalaya.${{ matrix.target }}.zip" - path: result/himalaya.zip + name: "himalaya-repl.${{ matrix.target }}.zip" + path: result/himalaya-repl.zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44b819d..652beb3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,56 +22,49 @@ jobs: draft: false prerelease: false - deploy-unix-releases: + deploy-releases: runs-on: ${{ matrix.os }} needs: create-release strategy: fail-fast: false matrix: include: - - target: linux + - target: x86_64-linux os: ubuntu-latest - - target: linux-musl + - target: aarch64-linux os: ubuntu-latest - - target: macos - os: macos-latest - # TODO: uncomment once nix build .#windows works - # - target: windows - # os: ubuntu-latest + - target: x86_64-windows + os: ubuntu-latest + - target: x86_64-darwin + os: macos-13 + - target: aarch64-darwin + os: macos-14 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v26 + uses: cachix/install-nix-action@v27 with: - nix_path: nixpkgs=channel:nixos-23.11 + nix_path: nixpkgs=channel:nixos-24.05 extra_nix_config: | experimental-features = nix-command flakes - - uses: cachix/cachix-action@v12 + - uses: cachix/cachix-action@v15 with: name: soywod authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - name: Build release - run: nix build -L .#${{ matrix.target }} - - name: Copy binary - run: | - cp result/bin/himalaya* . - - name: Patch binary interpreter - if: ${{ matrix.target == 'linux' }} - run: | - nix-shell -p patchelf --command "sudo patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 himalaya-repl" - - name: Prepare release archives + extraPullNames: nix-community + - name: Build release archive run: | - tar -czf himalaya-repl.tgz himalaya* - zip -r himalaya-repl.zip himalaya* - - name: Upload tarball release archive + nix build -L .#${{ matrix.target }} + cp result/himalaya-repl* . + - name: Upload tgz release archive uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create-release.outputs.upload_url }} asset_path: himalaya-repl.tgz - asset_name: himalaya-repl-${{ matrix.target }}.tgz + asset_name: himalaya-repl.${{ matrix.target }}.tgz asset_content_type: application/gzip - name: Upload zip release archive uses: actions/upload-release-asset@v1 @@ -80,66 +73,5 @@ jobs: with: upload_url: ${{ needs.create-release.outputs.upload_url }} asset_path: himalaya-repl.zip - asset_name: himalaya-repl-${{ matrix.target }}.zip - asset_content_type: application/zip - - # TODO: remove me once nix build .#windows works - deploy-windows-release: - runs-on: windows-latest - needs: create-release - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - name: Build release - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - name: Copy binary - run: | - copy target/release/himalaya-repl.exe . - - name: Prepare release archives - run: | - tar -czf himalaya-repl.tgz himalaya-repl.exe - Compress-Archive -Path himalaya.exe -DestinationPath himalaya-repl.zip - - name: Upload tarball release archive - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: himalaya-repl.tgz - asset_name: himalaya-repl-windows.tgz - asset_content_type: application/gzip - - name: Upload zip release archive - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: himalaya.zip - asset_name: himalaya-repl-windows.zip + asset_name: himalaya-repl.${{ matrix.target }}.zip asset_content_type: application/zip - - publish-crates-io: - runs-on: ubuntu-latest - needs: create-release - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install Nix - uses: cachix/install-nix-action@v26 - with: - nix_path: nixpkgs=channel:nixos-23.11 - extra_nix_config: | - experimental-features = nix-command flakes - - name: Publish library to crates.io - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - nix develop -c cargo publish --no-verify --token ${CARGO_REGISTRY_TOKEN}