From 72cabf75b599d9f37b47a8df2ba173640f98d9cf Mon Sep 17 00:00:00 2001 From: Stephen Marshall Date: Wed, 25 Oct 2023 11:48:40 -0400 Subject: [PATCH] WIP --- .../workflows/github-actions-build-number.yml | 42 +++++++++++++++++++ Jenkinsfile | 10 ++--- Tools/setup-story-details.sh | 2 +- 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/github-actions-build-number.yml diff --git a/.github/workflows/github-actions-build-number.yml b/.github/workflows/github-actions-build-number.yml new file mode 100644 index 000000000..2e38ce32a --- /dev/null +++ b/.github/workflows/github-actions-build-number.yml @@ -0,0 +1,42 @@ +name: Update Build Number +run-name: ${{ github.actor }} is updating the build version 🛠️ +on: + pull_request: + types: [ labeled ] +jobs: + Update-Build-Number: + if: github.event.label.name == 'Ready for Testing' + runs-on: ubuntu-latest + # defaults: + # run: + # working-directory: ./PlaybookSwift + env: + # Set an environment variable for the branch name + BRANCH_NAME: ${{ github.head_ref }} + steps: + - uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Set Git Config + run: | + git config --local user.name "${{ github.actor }}" + git config --local user.email "${{ github.actor }}@users.noreply.github.com" + - name: Get Build Number + run: | + git clone --depth 5 git@github.com:powerhome/nitro-buildnumber.git . + echo $(ls nitro-buildnumber) + "666" >> ./buildNumber.txt + echo $(cat ./buildNumber.txt) + # - name: Leave PR comment + # env: + # PR_NUMBER: ${{ github.event.pull_request.number }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # RUBY_GEM_VERSION: ${{ env.new_ruby_alpha_version }} + # RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_alpha_version}} + # NPM_VERSION: ${{ env.new_npm_alpha_version }} + # NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_alpha_version}} + # run: | + # curl -H "Authorization: token ${GITHUB_TOKEN}" \ + # -X POST \ + # -d '{"body": "🎉 Congratulations on creating an Alpha Version! \n\n Your Alpha for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your Alpha for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \ + # "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" diff --git a/Jenkinsfile b/Jenkinsfile index c46362890..16e17c1e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,13 +16,8 @@ def steps = [ runNode { getReleaseNotes() def args = "type:${buildType()}" - // prepareToBuild(buildType()) buildAndShipiOS(args) } - // }, 'macOS': { - // runNode { - // buildAndShipMacOS(args) - // } } ] def map = steps @@ -332,8 +327,9 @@ def updateBuildNumber() { // clone repo dir('.buildnumber') { try { - sh 'git clone --depth 5 git@github.com:powerhome/nitro-buildnumber.git .' - buildNumber = sh(returnStdout: true, script: './increment PlaybookSwift-version').trim().toInteger() + // sh 'git clone --depth 5 git@github.com:powerhome/nitro-buildnumber.git .' + // buildNumber = sh(returnStdout: true, script: './increment PlaybookSwift-version').trim().toInteger() + buildNumber = 666 print "Build number: ${buildNumber}" } finally { diff --git a/Tools/setup-story-details.sh b/Tools/setup-story-details.sh index 686f135bd..f9820fe67 100755 --- a/Tools/setup-story-details.sh +++ b/Tools/setup-story-details.sh @@ -29,7 +29,7 @@ if [ -n "$GITHUB_PULL_REQUEST_ID" ]; then getPullRequestDetails "$GITHUB_PULL_REQUEST_ID" \ | tee "$PR_DETAILS" \ - | jq ". | {url, user, id, number, title, state, commits, mergeable}" + | jq ". | {commits, draft, id, mergeable, number, state, title, url, user}" export PR_USER_HANDLE=`jq -r .user.login "$PR_DETAILS"` else