From 1912425b21f8a93c62f3da7099a9af8cf39942dd Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Fri, 1 Jul 2022 05:30:27 +0530 Subject: Moved tagging of the repo from the nightly build process to the post-publishing process [skip ci] (#404) --- .github/workflows/builds.yml | 9 +-------- .github/workflows/tag-repos.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/tag-repos.yml diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index abc1b50d8..8d3a7646f 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -46,7 +46,6 @@ jobs: ref: nightly submodules: recursive fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging - # ssh-key: ${{ secrets.FERDIUM_PUBLISH_TOKEN }} - name: Use Node.js specified in the '.nvmrc' file uses: actions/setup-node@v3 if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }} @@ -77,15 +76,9 @@ jobs: # there were other changes coming from the 'develop' branch (or) # this is a manual trigger with the key-phrase git checkout develop - TAG_NAME=$(npm version -m "%s [skip ci]" prerelease --preid=nightly) + npm version -m "%s [skip ci]" prerelease --preid=nightly git commit --all --amend --no-edit --no-verify git push origin develop --no-verify - git tag -f $TAG_NAME - git push origin --tags --no-verify - # Also tag the submodule so as to help identify which changes went into which nightly release - # TODO: Not working due to cross-repo access issues by the github-action bot - # git -C recipes tag -f $TAG_NAME - # git -C recipes push origin --tags --no-verify git checkout nightly fi diff --git a/.github/workflows/tag-repos.yml b/.github/workflows/tag-repos.yml new file mode 100644 index 000000000..a8459c1e6 --- /dev/null +++ b/.github/workflows/tag-repos.yml @@ -0,0 +1,35 @@ +name: Tag all repos + +on: + release: + types: [published] + # Manual trigger from the UI + workflow_dispatch: + +jobs: + bump-casks: + runs-on: macos-latest + steps: + - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' + uses: actions/checkout@v3 + if: ${{ contains(github.event.release.tag_name, 'nightly') }} + with: + ref: nightly + submodules: recursive + fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging + - name: Checkout code along with submodules for the 'release' branch if the trigger event is 'scheduled' + uses: actions/checkout@v3 + if: ${{ !contains(github.event.release.tag_name, 'nightly') }} + with: + ref: release + submodules: recursive + fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging + - name: Tag the branch + run: | + TAG_NAME=$(node -p 'require("./package.json").version') + git tag -f $TAG_NAME + git push origin --tags --no-verify + # Also tag the submodule so as to help identify which changes went into which nightly release + # TODO: Not working due to cross-repo access issues by the github-action bot + # git -C recipes tag -f $TAG_NAME + # git -C recipes push origin --tags --no-verify -- cgit v1.2.3-54-g00ecf