From 240d98606e8eacf87513ca5829b1186dab6dfd15 Mon Sep 17 00:00:00 2001 From: rszyma Date: Tue, 5 Dec 2023 15:01:27 +0100 Subject: [PATCH] ci: add trigger.yml --- .github/workflows/publish.yml | 23 +++++------------------ .github/workflows/trigger.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/trigger.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 548654b..4cddcb3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,6 @@ name: publish on: - schedule: - - cron: '30 5 * * *' # every day at 5:30 AM workflow_dispatch: env: @@ -27,18 +25,9 @@ jobs: - name: Setup - just uses: taiki-e/install-action@just - - name: Check for new commits in kanata/parser - working-directory: - ./kanata - run: | - if git diff --quiet origin/main -- parser; then - # no new commits, skip release. - # todo: instead of canceling, pass, but without running remaining steps. - gh run cancel ${{ github.run_id }} - gh run watch ${{ github.run_id }} - fi - - name: Try bump kanata + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | status=$(just bump_kanata > /dev/null 2>&1; echo $?) if [ $status -eq 0 ]; then @@ -51,8 +40,6 @@ jobs: echo "Failed with $status" exit 1 fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup - cargo cache uses: actions/cache@v3 @@ -94,13 +81,13 @@ jobs: run: yarn global add vsce - name: Verify that VSCE_PAT is correct - run: vsce verify-pat rszyma env: VSCE_PAT: ${{ secrets.VSCE_ACCESS_TOKEN }} + run: vsce verify-pat rszyma - name: Build and publish + env: + VSCE_PAT: ${{ secrets.VSCE_ACCESS_TOKEN }} run: | make package just release ${{ steps.new_version.outputs.value }} - env: - VSCE_PAT: ${{ secrets.VSCE_ACCESS_TOKEN }} diff --git a/.github/workflows/trigger.yml b/.github/workflows/trigger.yml new file mode 100644 index 0000000..9fbb916 --- /dev/null +++ b/.github/workflows/trigger.yml @@ -0,0 +1,30 @@ +name: trigger + +on: + schedule: + - cron: '30 5 * * *' # every day at 5:30 AM + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + trigger: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Check for new commits in kanata/parser + working-directory: + ./kanata + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if git diff --quiet origin/main -- parser; then + # no new commits, skip release + else + gh workflow run publish.yml --wait + fi