-
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.
Showing
46 changed files
with
4,624 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,102 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
env: | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: "clang" | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C link-arg=-fuse-ld=/usr/local/bin/mold" | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: "clang" | ||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS: "-C link-arg=-fuse-ld=/usr/local/bin/mold" | ||
|
||
jobs: | ||
verify: | ||
name: Verify | ||
uses: ./.github/workflows/verify.yml | ||
|
||
create-release: | ||
needs: [verify] | ||
name: Create Github Release | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
outputs: | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
PKG_VERSION: ${{ env.PKG_VERSION }} | ||
steps: | ||
- name: Get the release version from the tag | ||
shell: bash | ||
if: env.PKG_VERSION== '' | ||
run: | | ||
echo "PKG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
echo "version is: ${{ env.VERSION }}" | ||
- name: Create GitHub release | ||
if: env.GITHUB_TOKEN != '' | ||
id: release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.PKG_VERSION }} | ||
release_name: ${{ env.PKG_VERSION }} | ||
|
||
build-release: | ||
name: Build Release | ||
needs: ['create-release'] | ||
runs-on: ubuntu-latest | ||
env: | ||
# Emit backtraces on panics. | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
target: x86_64-unknown-linux-gnu | ||
toolchain: stable | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
target: x86_64-unknown-linux-musl | ||
toolchain: stable | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
sudo ./scripts/install-deps.sh | ||
- name: Build GUI | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --bin shortcut-gui --target=x86_64-unknown-linux-gnu | ||
|
||
- name: Build Daemon | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --bin shortcut-daemon --target=x86_64-unknown-linux-musl | ||
|
||
- name: Strip release binaries | ||
run: | | ||
strip target/x86_64-unknown-linux-musl/release/shortcut-daemon | ||
strip target/x86_64-unknown-linux-gnu/release/shortcut-gui | ||
- name: Create archive | ||
run: | | ||
PKG_VERSION=${{ needs.create-release.outputs.PKG_VERSION }} scripts/package.sh | ||
staging="shortcut-${{ needs.create-release.outputs.PKG_VERSION }}" | ||
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | ||
- name: Upload release archive | ||
if: env.GITHUB_TOKEN != '' | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: ${{ env.ASSET }} | ||
asset_name: ${{ env.ASSET }} | ||
asset_content_type: application/octet-stream | ||
|
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,171 @@ | ||
name: Verify | ||
on: | ||
workflow_call: | ||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust_toolchain: [stable, nightly] | ||
name: Setup | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
components: clippy, rustfmt | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
name: Clippy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- uses: actions-rs/clippy-check@v1 | ||
if: env.GITHUB_TOKEN != '' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --workspace --all-targets -- -D warnings -W clippy::all | ||
|
||
- uses: actions-rs/cargo@v1 | ||
if: env.GITHUB_TOKEN == '' | ||
with: | ||
command: clippy | ||
args: --workspace --all-targets -- -D warnings -W clippy::all | ||
|
||
checks: | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
name: Checks | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: doc | ||
args: --no-deps | ||
|
||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
strategy: | ||
matrix: | ||
rust_toolchain: [stable, nightly] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
override: true | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
sudo ./scripts/install-deps.sh | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
args: --workspace --doc | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
args: --workspace --all-targets | ||
|
||
|
||
cargo-deny: | ||
needs: [setup] | ||
name: Cargo Deny | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
deny_checks: | ||
- advisories | ||
- bans licenses sources | ||
continue-on-error: ${{ matrix.deny_checks == 'advisories' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- uses: EmbarkStudios/cargo-deny-action@v1 | ||
with: | ||
command: check ${{ matrix.checks }} |
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,2 @@ | ||
target/ | ||
.cargo/ |
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,3 @@ | ||
This project is licensed under MIT licenses. | ||
|
||
You may use this code under the terms this license. |
Oops, something went wrong.