Release v1.0.11 #37
Workflow file for this run
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
--- | |
name: "Tag Release Build" | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
jobs: | |
tag-release: | |
name: Tag Release Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [stable] | |
TARGET: | |
- x86_64-unknown-linux-gnu | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Toolchain setup | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
target: ${{ matrix.TARGET }} | |
- name: Cross setup | |
run: cargo install cross | |
- name: Test | |
run: cross test --target=${{ matrix.TARGET }} | |
- name: Build | |
run: cross build --release | |
# Release Lib to crates.io | |
release-lib-crates: | |
name: Release Lib to crates.io | |
runs-on: ubuntu-latest | |
needs: [tag-release] | |
if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false ) | |
strategy: | |
matrix: | |
RUST: [stable] | |
TARGET: | |
- x86_64-unknown-linux-gnu | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Toolchain setup | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
target: ${{ matrix.TARGET }} | |
- name: Publish API to crates.io | |
env: | |
CARGO_REGISTRY_TOKEN: "${{ secrets.CRATES_TOKEN }}" | |
run: cargo publish -p alienware | |
- name: Create CLI Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: "${{ github.ref_name }}" | |
name: "Release ${{ github.ref_name }}" | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
files: | | |
LICENSE | |
target/release/alienware-cli | |
- name: Sleep for 10 seconds so that crates.io can update it's references to alienware | |
run: sleep 10s | |
shell: bash | |
# Release CLI to crates.io | |
release-cli-crates: | |
name: Release CLI to crates.io | |
runs-on: ubuntu-latest | |
needs: [release-lib-crates] | |
if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false ) | |
strategy: | |
matrix: | |
RUST: [stable] | |
TARGET: | |
- x86_64-unknown-linux-gnu | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Toolchain setup | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
target: ${{ matrix.TARGET }} | |
- name: Publish CLI to crates.io | |
env: | |
CARGO_REGISTRY_TOKEN: "${{ secrets.CRATES_TOKEN }}" | |
run: cargo publish -p alienware_cli | |
# Create the release artifacts in GitHub | |
release-gh: | |
name: Create the release artifacts in GitHub | |
runs-on: ubuntu-latest | |
needs: [tag-release] | |
if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false ) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Create CLI Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: "${{ github.ref_name }}" | |
name: "Release ${{ github.ref_name }}" | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
files: | | |
LICENSE | |
target/release/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 | |
runs-on: ubuntu-latest | |
needs: [release-cli-crates] | |
if: github.ref_type == 'tag' && ( contains(github.ref_name, '-') == false ) | |
steps: | |
- name: Repository Dispatch | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
token: ${{ secrets.PAT }} | |
repo: a1ecbr0wn/alienware-wmi | |
ref: refs/heads/main | |
workflow: snap.yml | |
inputs: '{ "snap_version": "${{ github.ref_name }}" }' |