-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2b38995
Showing
12 changed files
with
5,341 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: soywod |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
steps: | ||
- name: Create release | ||
id: create-release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
deploy-unix-releases: | ||
runs-on: ${{ matrix.os }} | ||
needs: create-release | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: linux | ||
os: ubuntu-latest | ||
- target: linux-musl | ||
os: ubuntu-latest | ||
- target: macos | ||
os: macos-latest | ||
# TODO: uncomment once nix build .#windows works | ||
# - target: windows | ||
# os: ubuntu-latest | ||
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 | ||
- uses: cachix/cachix-action@v12 | ||
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 | ||
run: | | ||
tar -czf himalaya-repl.tgz himalaya* | ||
zip -r himalaya-repl.zip himalaya* | ||
- 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-${{ matrix.target }}.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-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_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} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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@v26 | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Cargo config directory | ||
.cargo/ | ||
|
||
# Cargo build directory | ||
target/ | ||
debug/ | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
# Nix build directory | ||
result | ||
result-* | ||
|
||
# Direnv | ||
/.envrc | ||
/.direnv | ||
|
||
|
||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
.idea/ | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# SonarLint plugin | ||
.idea/sonarlint/ | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
## Others | ||
.metadata/ |
Oops, something went wrong.