Skip to content

Commit

Permalink
removal of actions-rs (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ecbr0wn authored Apr 19, 2023
1 parent 2860ee9 commit 4e11d1f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 71 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:

jobs:
build:
name: "CI Build"
name: CI Build
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -35,25 +35,20 @@ jobs:
- x86_64-unknown-linux-gnu

steps:
- name: "Checkout"
- name: Checkout
uses: actions/checkout@v3

- name: "Toolchain setup"
uses: actions-rs/toolchain@v1
- name: Toolchain setup
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true

- name: "Build"
uses: actions-rs/cargo@v1
with:
command: build
- name: Cross setup
run: cargo install cross

- name: "Test"
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target=${{ matrix.TARGET }}
- name: Build
run: cross build

- name: Test
run: cross test --target=${{ matrix.TARGET }}
10 changes: 2 additions & 8 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,16 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
components: clippy
override: true

- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt

- name: Run rust-clippy
run:
cargo clippy
--all-targets
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
run: cargo clippy --all-targets --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true

- name: Upload analysis results to GitHub
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
override: true
- uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
72 changes: 28 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,35 @@ on:

jobs:
tag-release:
name: "Tag Release Build"
runs-on: "ubuntu-latest"
name: Tag Release Build
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
TARGET:
- x86_64-unknown-linux-gnu

steps:
- name: "Checkout"
- name: Checkout
uses: actions/checkout@v3

- name: "Toolchain setup"
uses: actions-rs/toolchain@v1
- name: Toolchain setup
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true

- name: "Build"
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Cross setup
run: cargo install cross

- name: "Test"
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target=${{ matrix.TARGET }}
- name: Test
run: cross test --target=${{ matrix.TARGET }}

- name: Build
run: cross build --release

release-lib:
name: "Release Lib to crates.io"
name: Release Lib to crates.io
runs-on: ubuntu-latest
needs: [tag-release]
if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false )
Expand All @@ -54,27 +48,22 @@ jobs:
- x86_64-unknown-linux-gnu

steps:
- name: "Checkout"
- name: Checkout
uses: actions/checkout@v3

- name: "Toolchain setup"
uses: actions-rs/toolchain@v1
- name: Toolchain setup
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true

- name: "Publish API to crates.io"
- name: Publish API to crates.io
env:
CARGO_REGISTRY_TOKEN: "${{ secrets.CRATES_TOKEN }}"
uses: actions-rs/cargo@v1
with:
command: publish
args: -p alienware
run: cargo publish -p alienware

- name: "Create CLI Release"
uses: "marvinpinto/action-automatic-releases@latest"
- name: Create CLI Release
uses: marvinpinto/action-automatic-releases@latest
with:
automatic_release_tag: "latest"
title: "Release ${{ github.ref_name }}"
Expand All @@ -89,7 +78,7 @@ jobs:
shell: bash

release-cli-crates:
name: "Release CLI to crates.io"
name: Release CLI to crates.io
runs-on: ubuntu-latest
needs: [release-lib]
if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false )
Expand All @@ -100,33 +89,28 @@ jobs:
- x86_64-unknown-linux-gnu

steps:
- name: "Checkout"
- name: Checkout
uses: actions/checkout@v3

- name: "Toolchain setup"
uses: actions-rs/toolchain@v1
- name: Toolchain setup
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true

- name: "Publish CLI to crates.io"
- name: Publish CLI to crates.io
env:
CARGO_REGISTRY_TOKEN: "${{ secrets.CRATES_TOKEN }}"
uses: actions-rs/cargo@v1
with:
command: publish
args: -p alienware_cli
run: cargo publish -p alienware_cli

# Kick off the workflow in this repo that will generate the snapcraft yaml file
release-cli-snap:
name: "Initiate release of the alienware cli application"
name: Initiate release of the alienware cli application
runs-on: ubuntu-latest
needs: [tag-release]

steps:
- name: "Repository Dispatch"
- name: Repository Dispatch
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.PAT }}
Expand Down

0 comments on commit 4e11d1f

Please sign in to comment.