chore(ci): Replace unmaintained actions-rs GH actions, closes #8078 (#8093)

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Olivier Lemasle
2023-10-26 20:27:52 +02:00
committed by GitHub
parent 6bc3b0536d
commit 9ed400a85c
20 changed files with 93 additions and 395 deletions

View File

@@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: rust audit
uses: actions-rs/audit-check@v1
uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -36,14 +36,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
- name: install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
override: true
default: true
components: rust-src
target: ${{ matrix.platform.target }}
targets: ${{ matrix.platform.target }}
- name: setup python
uses: actions/setup-python@v4

View File

@@ -17,7 +17,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter

View File

@@ -25,7 +25,7 @@ jobs:
api: ${{ steps.filter.outputs.api }}
schema: ${{ steps.filter.outputs.schema }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
@@ -43,7 +43,7 @@ jobs:
needs: changes
if: needs.changes.outputs.api == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build api
working-directory: tooling/api
@@ -56,13 +56,10 @@ jobs:
needs: changes
if: needs.changes.outputs.schema == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable
- name: install Linux dependencies
run: |
@@ -74,10 +71,7 @@ jobs:
workspaces: core -> ../target
- name: generate schema.json
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./core/tauri-config-schema/Cargo.toml
run: cargo build --manifest-path ./core/tauri-config-schema/Cargo.toml
- name: check schema
run: ./.scripts/ci/has-diff.sh

View File

@@ -1,148 +0,0 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: covector version or publish
on:
push:
branches:
- 1.x
jobs:
run-integration-tests:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
core -> ../target
tooling/cli
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
- name: run integration tests
run: cargo test --test '*' -- --ignored
- name: run CLI tests
timeout-minutes: 30
run: |
cd ./tooling/cli/node
yarn
yarn build
yarn test
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 65
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
needs:
- run-integration-tests
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
- name: cargo login
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0
id: covector
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'version-or-publish'
createRelease: true
- name: Create Pull Request With Versions Bumped
if: steps.covector.outputs.commandRan == 'version'
uses: tauri-apps/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates-v1
title: Apply Version Updates From Current Changes (v1)
commit-message: 'apply version updates'
labels: 'version updates'
body: ${{ steps.covector.outputs.change }}
- name: Trigger doc update
if: |
steps.covector.outputs.successfulPublish == 'true' &&
steps.covector.outputs.packagesPublished != ''
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri-docs
event-type: update-docs
- name: Get `@tauri-apps/cli` release id
id: cliReleaseId
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
run: |
echo '${{ steps.covector.outputs }}' > output.json
id=$(jq '.["-tauri-apps-cli-releaseId"]' < output.json)
rm output.json
echo "cliReleaseId=$id" >> "$GITHUB_OUTPUT"
- name: Trigger `@tauri-apps/cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-js-cli
client-payload: '{"releaseId": "${{ steps.cliReleaseId.outputs.cliReleaseId }}" }'
- name: Trigger `tauri-cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-clirs

View File

@@ -22,10 +22,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
@@ -39,10 +39,7 @@ jobs:
tooling/cli
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
run: cargo build --manifest-path ./tooling/cli/Cargo.toml
- name: run integration tests
run: cargo test --test '*' -- --ignored

View File

@@ -17,12 +17,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: install Linux dependencies
run: |
@@ -40,10 +38,7 @@ jobs:
if-no-files-found: error
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
run: cargo build --manifest-path ./tooling/cli/Cargo.toml
- name: Upload CLI
uses: actions/upload-artifact@v3
@@ -64,15 +59,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: install stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
default: true
target: ${{ matrix.target.name }}
targets: ${{ matrix.target.name }}
- name: Setup node
uses: actions/setup-node@v3

View File

@@ -29,17 +29,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: install Rust stable and rustfmt
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
- name: Run cargo fmt
run: cargo fmt --manifest-path ./tooling/cli/Cargo.toml --all -- --check
clippy:
runs-on: ubuntu-latest
@@ -47,11 +43,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: install Rust stable and clippy
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: install dependencies
@@ -63,8 +57,5 @@ jobs:
with:
workspaces: tooling/cli
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
name: cli
- name: run Clippy
run: cargo clippy --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings

View File

@@ -31,17 +31,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: install Rust stable and rustfmt
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: run cargo fmt
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
@@ -60,11 +56,9 @@ jobs:
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
- uses: actions-rs/toolchain@v1
- name: install Rust stable with clippy
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
@@ -72,8 +66,5 @@ jobs:
workspaces: core -> ../target
save-if: ${{ matrix.clippy.key == 'all' }}
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
name: ${{ matrix.clippy.key }}
- name: Run clippy - ${{ matrix.clippy.key }}
run: cargo clippy --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings

View File

@@ -91,7 +91,7 @@ jobs:
name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
if: ${{ !matrix.settings.docker }}
@@ -101,14 +101,11 @@ jobs:
cache: yarn
cache-dependency-path: 'tooling/cli/node/yarn.lock'
architecture: ${{ matrix.settings.architecture }}
- name: Install
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
profile: minimal
override: true
toolchain: stable
target: ${{ matrix.settings.target }}
targets: ${{ matrix.settings.target }}
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.settings.target }}
@@ -144,7 +141,7 @@ jobs:
# runs-on: macos-10.15
# name: Build FreeBSD
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - name: Build
# id: build
# uses: vmactions/freebsd-vm@v0.1.6
@@ -207,7 +204,7 @@ jobs:
- '18'
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
@@ -240,7 +237,7 @@ jobs:
- '18'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
@@ -279,7 +276,7 @@ jobs:
container:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
@@ -329,7 +326,7 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
working-directory: ${{ github.workspace }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: List packages
run: ls -R .
shell: bash
@@ -375,7 +372,7 @@ jobs:
- test-linux-x64-musl-binding
#- test-linux-arm-bindings
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:

View File

@@ -40,7 +40,7 @@ jobs:
args: '--no-default-features --features native-tls-vendored'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Setup Rust'
uses: dtolnay/rust-toolchain@stable
@@ -58,10 +58,7 @@ jobs:
sudo apt-get install -y libgtk-3-dev
- name: Build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}
run: cargo build --manifest-path ./tooling/cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}
- name: Upload CLI
uses: actions/upload-artifact@v3
@@ -76,7 +73,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download built CLIs
uses: actions/download-artifact@v3

View File

@@ -31,13 +31,10 @@ jobs:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
@@ -74,10 +71,7 @@ jobs:
examples/api/src-tauri
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
run: cargo build --manifest-path ./tooling/cli/Cargo.toml
- name: build Tauri API
working-directory: ./tooling/api

View File

@@ -36,10 +36,8 @@ jobs:
- uses: actions/checkout@v4
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable
- name: setup node
uses: actions/setup-node@v2
with:

View File

@@ -67,7 +67,4 @@ jobs:
workspaces: tooling/cli
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }}
run: cargo build --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }}

View File

@@ -73,13 +73,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install stable
uses: actions-rs/toolchain@v1
- name: install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.platform.toolchain }}
target: ${{ matrix.platform.target }}
override: true
default: true
targets: ${{ matrix.platform.target }}
- name: install Linux dependencies
if: contains(matrix.platform.target, 'unknown-linux')

View File

@@ -35,9 +35,7 @@ jobs:
- uses: actions/checkout@v4
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
@@ -54,17 +52,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- name: install Rust stable and rustfmt
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
- name: Run cargo fmt
run: cargo fmt --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
clippy:
runs-on: ubuntu-latest
@@ -72,22 +66,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
- name: install Rust stable and clippy
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
default: true
components: rustfmt, clippy
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: tooling/bundler
- name: clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
name: bundler
run: cargo clippy --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings

View File

@@ -74,16 +74,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- uses: actions-rs/cargo@v1
with:
command: install
args: cargo-udeps --locked --force
- name: Install udeps
run: cargo install cargo-udeps --locked --force
- name: Upload udeps
uses: actions/upload-artifact@v3
@@ -128,11 +123,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: install dependencies
run: |
@@ -159,7 +151,5 @@ jobs:
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
- uses: actions-rs/cargo@v1
with:
command: udeps
args: --manifest-path ${{ matrix.path }}/Cargo.toml --all-targets --all-features
- name: Run udeps
run: cargo udeps --manifest-path ${{ matrix.path }}/Cargo.toml --all-targets --all-features