Skip to content

Commit

Permalink
fix workflows bin name
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Oct 10, 2024
1 parent 2674ed1 commit 060db7a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 92 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
108 changes: 20 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}

0 comments on commit 060db7a

Please sign in to comment.