Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

musl -> cross #1

Merged
merged 15 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/build.yml

This file was deleted.

70 changes: 52 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,63 @@
on:
release:
types: [created]
on:
push:
tags:
- "v*.*.*"

jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: tar.gz
- target: x86_64-unknown-linux-musl
archive: tar.gz
- target: x86_64-apple-darwin
archive: tar.gz
# @see https://doc.rust-lang.org/nightly/rustc/platform-support.html

# 64-bit Linux (kernel 3.2+, glibc 2.17+)
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# ARM64 Linux (kernel 4.1, glibc 2.17+)
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
# 64-bit MSVC (Windows 7+)
- os: windows-latest
target: x86_64-pc-windows-msvc
# 64-bit macOS (10.7+, Lion+)
- os: macOS-latest
target: x86_64-apple-darwin
# ARM64 macOS (11.0+, Big Sur+)
- os: macOS-latest
target: aarch64-apple-darwin

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
# - name: install
# run: sudo apt-get install openssl
- name: Compile and release
uses: rust-build/rust-build.action@v1.3.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
- name: Run build
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
mv target/${{ matrix.target }}/release/create-release-pr.exe target/${{ matrix.target }}/release/create-release-pr
fi
- name: Compress action step
uses: a7ul/tar-action@v1.1.0
id: compress
with:
command: c
cwd: ./target/${{ matrix.target }}/release/
files: |
create-release-pr
outPath: create-release-pr_${{github.ref_name}}_${{ matrix.target }}.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
generate_release_notes: true
files: create-release-pr_${{github.ref_name}}_${{ matrix.target }}.tar.gz
36 changes: 36 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: test

on:
push:
branches:
- "*"

jobs:
test:
name: run test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- uses: actions-rs/cargo@v1
with:
command: test
args: --release --all-features
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ get_arch() {
# echo "386"
# ;;
"aarch64" | "arm64" | "arm")
echo "arm64"
echo "aarch64"
;;
*)
echo ${NIL}
Expand All @@ -42,10 +42,10 @@ get_os(){
echo "apple-darwin"
;;
"windows")
echo "pc-windows-gnu"
echo "pc-windows-msvc"
;;
"linux")
echo "unknown-linux-musl"
echo "unknown-linux-gnu"
;;
*)
echo ${NIL}
Expand Down