release v1.0.0-beta.4

This commit is contained in:
Clément DOUIN
2024-04-16 21:26:00 +02:00
parent 23ae40e728
commit 10de8e9fb4
10 changed files with 209 additions and 242 deletions
+11 -97
View File
@@ -22,22 +22,21 @@ 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: arm64-linux
os: ubuntu-latest
- target: macos
- target: x86_64-windows
os: ubuntu-latest
- target: x86_64-macos
os: macos-latest
# TODO: uncomment once nix build .#windows works
# - target: windows
# os: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
@@ -51,34 +50,18 @@ jobs:
with:
name: soywod
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build release
run: nix build -L .#${{ matrix.target }}
- name: Copy binary
- name: Build release archive
run: |
nix build -L .#${{ matrix.target }}
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"
- name: Prepare release archives
run: |
mkdir -p {man,completions}
nix run .#${{ matrix.target }} man ./man
nix run .#${{ matrix.target }} completion bash > ./completions/himalaya.bash
nix run .#${{ matrix.target }} completion elvish > ./completions/himalaya.elvish
nix run .#${{ matrix.target }} completion fish > ./completions/himalaya.fish
nix run .#${{ matrix.target }} completion powershell > ./completions/himalaya.powershell
nix run .#${{ matrix.target }} completion zsh > ./completions/himalaya.zsh
tar -czf himalaya.tgz himalaya* man completions
zip -r himalaya.zip himalaya* man completions
- name: Upload tarball release archive
- 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.tgz
asset_name: himalaya-${{ matrix.target }}.tgz
asset_name: himalaya.${{ matrix.target }}.tgz
asset_content_type: application/gzip
- name: Upload zip release archive
uses: actions/upload-release-asset@v1
@@ -87,74 +70,5 @@ jobs:
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: himalaya.zip
asset_name: himalaya-${{ matrix.target }}.zip
asset_name: himalaya.${{ 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.exe .
- name: Prepare release archives
run: |
mkdir man
mkdir completions
./himalaya.exe man ./man
./himalaya.exe completion bash > ./completions/himalaya.bash
./himalaya.exe completion elvish > ./completions/himalaya.elvish
./himalaya.exe completion fish > ./completions/himalaya.fish
./himalaya.exe completion powershell > ./completions/himalaya.powershell
./himalaya.exe completion zsh > ./completions/himalaya.zsh
tar -czf himalaya.tgz himalaya.exe man completions
Compress-Archive -Path himalaya.exe,man,completions -DestinationPath himalaya.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.tgz
asset_name: himalaya-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-windows.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@v24
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}
-24
View File
@@ -1,24 +0,0 @@
name: tests
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: soywod
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build then test
run: nix build