From c22efd4efd08db4ca08c21b4badb276f6c489078 Mon Sep 17 00:00:00 2001 From: Edward Foyle Date: Wed, 3 Apr 2024 16:14:47 -0700 Subject: [PATCH] update workflow definitions --- .github/workflows/deprecate_release.yml | 5 +++ .github/workflows/restore_release.yml | 47 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/restore_release.yml diff --git a/.github/workflows/deprecate_release.yml b/.github/workflows/deprecate_release.yml index d38f7705f4..ffb42c582b 100644 --- a/.github/workflows/deprecate_release.yml +++ b/.github/workflows/deprecate_release.yml @@ -1,6 +1,7 @@ name: deprecate_release on: + # TODO remove push trigger before merging push: branches: - rollback @@ -39,6 +40,10 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # TODO remove test inputs before merging + INPUT_DEPRECATIONMESSAGE: test deprecation message + INPUT_USENPMREGISTRY: false + INPUT_SEARCHFORRELEASESTARTINGFROM: HEAD steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0 - uses: ./.github/actions/setup_node diff --git a/.github/workflows/restore_release.yml b/.github/workflows/restore_release.yml new file mode 100644 index 0000000000..04cee777c7 --- /dev/null +++ b/.github/workflows/restore_release.yml @@ -0,0 +1,47 @@ +name: restore_release + +on: + # TODO remove push trigger before merging + push: + branches: + - rollback + workflow_dispatch: + inputs: + useNpmRegistry: + required: false + type: boolean + default: false + description: | + Whether to run the workflow against the live npm registry or not. + Defaults to false. Must be explicitly set to true to run against the npm registry. + searchForReleaseStartingFrom: + required: false + type: string + default: HEAD + description: | + By default, the most recent release from HEAD (inclusive) of the target branch will be deprecated. + To deprecate a different release, specify the release commit to deprecate here. + +jobs: + install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0 + - uses: ./.github/actions/setup_node + - uses: ./.github/actions/install_with_cache + restore_release: + needs: + - install + runs-on: ubuntu-latest + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # TODO remove test inputs before merging + INPUT_USENPMREGISTRY: false + INPUT_SEARCHFORRELEASESTARTINGFROM: HEAD + steps: + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0 + - uses: ./.github/actions/setup_node + - uses: ./.github/actions/restore_install_cache + - name: Restore release versions + run: npx tsx scripts/restore_release.ts