From a1ce72a6da3e7da4f874cee57a4b8273570be0fc Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 14 Feb 2024 23:52:52 +0100 Subject: [PATCH 1/2] Add a release_tag input for the upload-binary action --- .github/actions/upload-binary/action.yml | 5 +++++ .github/actions/upload-binary/index.js | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/actions/upload-binary/action.yml b/.github/actions/upload-binary/action.yml index 4e40e22..55c2afc 100644 --- a/.github/actions/upload-binary/action.yml +++ b/.github/actions/upload-binary/action.yml @@ -5,6 +5,11 @@ inputs: ruby_path: description: 'path to ruby root folder (TOPDIR)' default: '' + release_tag: + description: 'tag of the release to upload to' + default: 'ruby-master' + required: true + runs: using: 'node20' main: 'index.js' diff --git a/.github/actions/upload-binary/index.js b/.github/actions/upload-binary/index.js index 62898ad..25d7399 100644 --- a/.github/actions/upload-binary/index.js +++ b/.github/actions/upload-binary/index.js @@ -556,8 +556,8 @@ class OidcClient { const res = yield httpclient .getJson(id_token_url) .catch(error => { - throw new Error(`Failed to get ID Token. \n - Error Code : ${error.statusCode}\n + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; @@ -8498,7 +8498,7 @@ module.exports = require("util"); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; -/******/ +/******/ /******/ // The require function /******/ function __nccwpck_require__(moduleId) { /******/ // Check if module is in cache @@ -8512,7 +8512,7 @@ module.exports = require("util"); /******/ // no module.loaded needed /******/ exports: {} /******/ }; -/******/ +/******/ /******/ // Execute the module function /******/ var threw = true; /******/ try { @@ -8521,16 +8521,16 @@ module.exports = require("util"); /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; /******/ } -/******/ +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } -/******/ +/******/ /************************************************************************/ /******/ /* webpack/runtime/compat */ -/******/ +/******/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; -/******/ +/******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. @@ -8590,10 +8590,10 @@ const create7z = async fn => { const run = async () => { try { - const releaseTag = 'ruby-master' - const rubyPath = core.getInput('ruby_path', { required: true }); + const releaseTag = core.getInput('release_tag', { required: true }); + // application/x-7z-compressed application/octet-stream const assetContentType = 'application/x-7z-compressed' @@ -8738,4 +8738,4 @@ run() module.exports = __webpack_exports__; /******/ })() -; \ No newline at end of file +; From c092b8d261964152d3a6a6e342a34af5767e543d Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 15 Feb 2024 00:04:11 +0100 Subject: [PATCH 2/2] Add workflow-dispatch inputs (and env vars) to parametrize what to build --- .github/workflows/mswin.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mswin.yml b/.github/workflows/mswin.yml index 83b5e91..1110a09 100644 --- a/.github/workflows/mswin.yml +++ b/.github/workflows/mswin.yml @@ -6,6 +6,16 @@ on: schedule: - cron: '50 1,8,15 * * *' workflow_dispatch: + inputs: + ruby_ref: + description: 'branch or tag to checkout in the ruby repo' + default: 'master' + ruby_repo: + description: 'github repo owner/repo where to pull ruby from' + default: 'ruby/ruby' + release_tag: + description: 'tag of the release to upload to' + default: 'ruby-master' jobs: mswin: @@ -16,6 +26,9 @@ jobs: runs-on: windows-${{ matrix.vs }} env: PRE: ruby-mswin + ruby_ref: master + release_tag: ruby-master + ruby_repo: 'ruby/ruby' steps: - name: git config @@ -32,13 +45,20 @@ jobs: with: ruby-version: mswin + - name: Handle workflow dispatch inputs + if: github.event_name == 'workflow_dispatch' + run: | + echo "ruby_ref=${{ github.event.inputs.ruby_ref}}" >> $env:GITHUB_ENV + echo "release_tag=${{ github.event.inputs.release_tag}}" >> $env:GITHUB_ENV + echo "ruby_repo=${{ github.event.inputs.ruby_repo}}" >> $env:GITHUB_ENV + # cert file is created with RubyInstaller2 - name: Get Ruby and RubyInstaller2 repos timeout-minutes: 5 run: | $gh = 'https://github.com' git clone -q --depth=1 --no-tags --branch=master $gh/oneclick/rubyinstaller2.git ./rubyinstaller2 - git clone -q --depth=1 --no-tags --branch=master $gh/ruby/ruby.git ./ruby + git clone -q --depth=1 --no-tags --branch=${{ env.ruby_ref }} $gh/${{ env.ruby_repo }}.git ./ruby cd ruby ruby ../git_log_utc.rb @@ -82,6 +102,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: ruby_path: ./${{ env.PRE }} + release_tag: ${{ env.release_tag }} - name: save log artifact if: success() || failure()