Skip to content

✨ Add inspect to prompt commands #46

✨ Add inspect to prompt commands

✨ Add inspect to prompt commands #46

Workflow file for this run

on:
push:
branches:
- master
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
build:
needs: lint
if: github.ref == 'refs/heads/master'
strategy:
fail-fast: false
matrix:
job:
- {
target: x86_64-unknown-linux-musl,
exe: amd64-linux,
os: ubuntu-latest,
}
- {
target: aarch64-unknown-linux-musl,
exe: aarch64-linux,
os: ubuntu-latest,
}
- { target: x86_64-apple-darwin, exe: macos, os: macos-latest }
runs-on: ${{ matrix.job.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.job.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: true
args: --release --target=${{ matrix.job.target }} --locked
command: build
- name: Rename result
run: |
rm target/${{ matrix.job.target }}/release/supdock.d
cp target/${{ matrix.job.target }}/release/supdock* supdock-${{ matrix.job.exe }}
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: bin
path: supdock-${{ matrix.job.exe }}
release:
needs: build
environment: production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
outputs:
tag_exists: ${{ steps.check_tag.outputs.exists }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: bin
path: bin
- name: Get current package version
id: current_version
run: echo "version=$(make version)" >> $GITHUB_OUTPUT
- uses: mukunku/[email protected]
id: check_tag
with:
tag: "${{ steps.current_version.outputs.version }}"
- uses: "marvinpinto/action-automatic-releases@latest"
if: steps.check_tag.outputs.exists == 'false'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.current_version.outputs.version }}"
prerelease: false
files: |
./bin/supdock-macos
./bin/supdock-aarch64-linux
./bin/supdock-amd64-linux
cargo:
needs: release
environment: production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && needs.release.outputs.tag_exists == 'false'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Publish to Cargo
run: cargo publish --allow-dirty || true
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
npm:
needs: [release, cargo]
environment: production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && needs.release.outputs.tag_exists == 'false'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- uses: actions/download-artifact@v3
with:
name: bin
path: bin
- name: Get current package version
id: current_version
run: echo "version=$(make version)" >> $GITHUB_OUTPUT
- name: Publish to NPM
run: |
npm version ${{ steps.current_version.outputs.version }} --no-git-tag-version --no-commit-hooks --allow-same-version
npm publish || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}