2022-08-28 21:13:21 +03:00
|
|
|
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
2021-04-11 01:09:09 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2020-07-19 23:50:56 +03:00
|
|
|
name: version or publish
|
2020-07-19 23:33:12 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
|
|
|
|
jobs:
|
2022-06-29 21:22:39 +03:00
|
|
|
run-integration-tests:
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-11-05 00:26:30 +03:00
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
2022-06-29 21:22:39 +03:00
|
|
|
|
|
|
|
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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
|
|
|
|
2022-11-05 00:26:30 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2022-06-29 21:22:39 +03:00
|
|
|
with:
|
2022-11-05 00:26:30 +03:00
|
|
|
workspaces: |
|
2022-11-06 22:27:29 +03:00
|
|
|
core -> ../target
|
2022-11-05 00:26:30 +03:00
|
|
|
tooling/cli
|
2022-06-29 21:22:39 +03:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2020-07-19 23:33:12 +03:00
|
|
|
version-or-publish:
|
|
|
|
runs-on: ubuntu-latest
|
2020-11-10 17:46:23 +03:00
|
|
|
timeout-minutes: 65
|
2020-07-20 08:19:35 +03:00
|
|
|
outputs:
|
|
|
|
change: ${{ steps.covector.outputs.change }}
|
|
|
|
commandRan: ${{ steps.covector.outputs.commandRan }}
|
|
|
|
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
2022-06-29 21:22:39 +03:00
|
|
|
needs:
|
|
|
|
- run-integration-tests
|
2020-07-19 23:33:12 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-10-22 17:33:02 +03:00
|
|
|
- uses: actions/setup-node@v2
|
2020-07-19 23:33:12 +03:00
|
|
|
with:
|
2020-11-10 17:46:23 +03:00
|
|
|
node-version: 14
|
2022-02-09 02:02:51 +03:00
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2021-10-22 17:33:02 +03:00
|
|
|
cache: yarn
|
|
|
|
cache-dependency-path: tooling/*/yarn.lock
|
2022-02-09 02:02:51 +03:00
|
|
|
|
2020-07-19 23:33:12 +03:00
|
|
|
- name: cargo login
|
2022-09-23 19:00:13 +03:00
|
|
|
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
2020-07-19 23:33:12 +03:00
|
|
|
- name: git config
|
|
|
|
run: |
|
|
|
|
git config --global user.name "${{ github.event.pusher.name }}"
|
|
|
|
git config --global user.email "${{ github.event.pusher.email }}"
|
2022-04-30 02:30:24 +03:00
|
|
|
|
2020-07-20 08:35:13 +03:00
|
|
|
- name: covector version or publish (publish when no change files present)
|
2022-02-13 06:56:06 +03:00
|
|
|
uses: jbolda/covector/packages/action@covector-v0
|
2020-07-19 23:33:12 +03:00
|
|
|
id: covector
|
2020-07-20 23:21:43 +03:00
|
|
|
env:
|
2022-09-23 19:00:13 +03:00
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
2020-11-10 16:59:04 +03:00
|
|
|
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
2020-07-19 23:33:12 +03:00
|
|
|
with:
|
2020-07-20 23:21:43 +03:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-31 02:55:42 +03:00
|
|
|
command: 'version-or-publish'
|
2020-07-20 07:34:16 +03:00
|
|
|
createRelease: true
|
2022-04-30 02:30:24 +03:00
|
|
|
|
2020-07-19 23:33:12 +03:00
|
|
|
- name: Create Pull Request With Versions Bumped
|
2020-07-23 05:00:28 +03:00
|
|
|
if: steps.covector.outputs.commandRan == 'version'
|
2022-09-23 19:00:13 +03:00
|
|
|
uses: tauri-apps/create-pull-request@v3
|
2020-07-19 23:33:12 +03:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: release/version-updates
|
|
|
|
title: Apply Version Updates From Current Changes
|
2022-02-09 02:02:51 +03:00
|
|
|
commit-message: 'apply version updates'
|
|
|
|
labels: 'version updates'
|
2020-07-19 23:33:12 +03:00
|
|
|
body: ${{ steps.covector.outputs.change }}
|
|
|
|
|
2022-02-09 02:02:51 +03:00
|
|
|
- name: Trigger doc update
|
2022-09-18 15:06:50 +03:00
|
|
|
if: |
|
|
|
|
steps.covector.outputs.successfulPublish == 'true' &&
|
|
|
|
steps.covector.outputs.packagesPublished != ''
|
2022-02-09 02:02:51 +03:00
|
|
|
uses: peter-evans/repository-dispatch@v1
|
2020-07-21 20:35:43 +03:00
|
|
|
with:
|
2022-09-23 19:00:13 +03:00
|
|
|
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
2022-02-09 02:02:51 +03:00
|
|
|
repository: tauri-apps/tauri-docs
|
|
|
|
event-type: update-docs
|
2022-02-10 04:11:00 +03:00
|
|
|
|
|
|
|
- name: Trigger cli.js publishing workflow
|
|
|
|
if: |
|
|
|
|
steps.covector.outputs.successfulPublish == 'true' &&
|
2022-02-11 02:08:54 +03:00
|
|
|
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
|
2022-02-10 04:11:00 +03:00
|
|
|
uses: peter-evans/repository-dispatch@v1
|
|
|
|
with:
|
2022-09-23 19:00:13 +03:00
|
|
|
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
2022-02-10 04:11:00 +03:00
|
|
|
repository: tauri-apps/tauri
|
|
|
|
event-type: publish-clijs
|
2022-09-16 22:16:29 +03:00
|
|
|
inputs: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }'
|
2022-08-03 00:54:40 +03:00
|
|
|
|
|
|
|
- name: Trigger cli.rs publishing workflow
|
|
|
|
if: |
|
|
|
|
steps.covector.outputs.successfulPublish == 'true' &&
|
|
|
|
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
|
|
|
|
uses: peter-evans/repository-dispatch@v1
|
|
|
|
with:
|
2022-09-23 19:00:13 +03:00
|
|
|
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
2022-08-03 00:54:40 +03:00
|
|
|
repository: tauri-apps/tauri
|
|
|
|
event-type: publish-clirs
|