Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to customize CI action #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/upload-binary/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
22 changes: 11 additions & 11 deletions .github/actions/upload-binary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -8512,7 +8512,7 @@ module.exports = require("util");
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/
/******/ // Execute the module function
/******/ var threw = true;
/******/ try {
Expand All @@ -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.
Expand Down Expand Up @@ -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'

Expand Down Expand Up @@ -8738,4 +8738,4 @@ run()

module.exports = __webpack_exports__;
/******/ })()
;
;
23 changes: 22 additions & 1 deletion .github/workflows/mswin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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()
Expand Down