diff --git a/.github/workflows/create-event-issue-community-meeting.yml b/.github/workflows/create-event-issue-community-meeting.yml new file mode 100644 index 000000000..7e8751c67 --- /dev/null +++ b/.github/workflows/create-event-issue-community-meeting.yml @@ -0,0 +1,32 @@ +name: Schedule Community Meeting + +on: + workflow_dispatch: + inputs: + time: + description: 'Info about meeting hour in UTC time zone, like: 08 or 16. No PM or AM versions.' + required: true + date: + description: 'Date in a form like: 2022-04-05 where 04 is a month and 05 is a day number.' + required: true + +jobs: + + setup-community-meeting: + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + name: Setup Community meeting + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Create issue content + uses: actions/github-script@v4 + id: date + with: + script: | + const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/meetings/community.js'); + const setupMeeting = require('./.github/workflows/event_issue_templates/index.js'); + setupMeeting('${{ github.event.inputs.date }}', '${{ github.event.inputs.time }}', core, getMeetingIssueContent); + - name: Create issue with meeting details + run: gh issue create -l meeting -t "Community Meeting, ${{steps.date.outputs.hour}}:00 UTC ${{steps.date.outputs.fullDate}}" -F content.md \ No newline at end of file diff --git a/.github/workflows/create-event-issue-lets-talk-about.yml b/.github/workflows/create-event-issue-lets-talk-about.yml new file mode 100644 index 000000000..ebbf2bd02 --- /dev/null +++ b/.github/workflows/create-event-issue-lets-talk-about.yml @@ -0,0 +1,36 @@ +name: Schedule Lets talk about contributing Meeting + +on: + workflow_dispatch: + inputs: + time: + description: 'Info about meeting hour in UTC time zone, like: 08 or 16. No PM or AM versions.' + required: true + date: + description: 'Date in a form like: 2022-04-05 where 04 is a month and 05 is a day number.' + required: true + descSuffix: + description: 'You can specify additional text that appears at the end of generated issue title, like: - Product Design' + required: false + default: '' + +jobs: + + setup-lets-talk-about-contrib-stream: + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + name: Setup Lets talk about contributing live stream + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Create issue content + uses: actions/github-script@v4 + id: date + with: + script: | + const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/meetings/lets-talk-about-contrib.js'); + const setupMeeting = require('./.github/workflows/event_issue_templates/index.js'); + setupMeeting('${{ github.event.inputs.date }}', '${{ github.event.inputs.time }}', core, getMeetingIssueContent); + - name: Create issue with meeting details + run: gh issue create -l meeting -t "Let's talk about contributing, ${{steps.date.outputs.hour}}:00 UTC ${{steps.date.outputs.fullDate}} ${{ github.event.inputs.descSuffix }}" -F content.md \ No newline at end of file diff --git a/.github/workflows/create-event-issue-spec-3-0.yml b/.github/workflows/create-event-issue-spec-3-0.yml new file mode 100644 index 000000000..efb501cd6 --- /dev/null +++ b/.github/workflows/create-event-issue-spec-3-0.yml @@ -0,0 +1,32 @@ +name: Schedule Spec 3.0 Meeting + +on: + workflow_dispatch: + inputs: + time: + description: 'Info about meeting hour in UTC time zone, like: 08 or 16. No PM or AM versions.' + required: true + date: + description: 'Date in a form like: 2022-04-05 where 04 is a month and 05 is a day number.' + required: true + +jobs: + + setup-spec-3-0-meeting: + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + name: Setup 3.0 spec meeting + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Create issue content + uses: actions/github-script@v4 + id: date + with: + script: | + const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/meetings/spec-3-0.js'); + const setupMeeting = require('./.github/workflows/event_issue_templates/index.js'); + setupMeeting('${{ github.event.inputs.date }}', '${{ github.event.inputs.time }}', core, getMeetingIssueContent); + - name: Create issue with meeting details + run: gh issue create -l meeting -t "Spec 3.0 Meeting, ${{steps.date.outputs.hour}}:00 UTC ${{steps.date.outputs.fullDate}}" -F content.md \ No newline at end of file diff --git a/.github/workflows/create-event-issue.yml b/.github/workflows/create-event-issue.yml deleted file mode 100644 index 63b9a71e6..000000000 --- a/.github/workflows/create-event-issue.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Create community event issue - -on: - workflow_dispatch: - inputs: - time: - description: 'Info about meeting hour in UTC time zone, like: 8 or 16' - required: true - everytimezone: - description: 'Link that points to specific time when meeting happens so others can translate it to their time zones, like: https://everytimezone.com/s/182f3172' - required: true - date: - description: 'Date in a form like: Tuesday October 26 2021' - required: true - type: - description: 'Is it "sig", "spec3-0" or "lets_talk_contrib" meeting' - required: true - descSuffix: - description: 'You can specify additional text that appears at the end of generated event title, like: - Product Design' - required: false - default: '' - -jobs: - - setup-sig-meeting: - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Setup SIG meeting - runs-on: ubuntu-latest - if: github.event.inputs.type == 'sig' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Create issue content - uses: actions/github-script@v4 - with: - script: | - const { writeFileSync } = require('fs'); - const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/sig.js'); - - const issueContent = getMeetingIssueContent('${{ github.event.inputs.time }}', '${{ github.event.inputs.everytimezone }}'); - - writeFileSync('content.md', issueContent, { encoding: 'utf8'}); - - name: Create issue with meeting details - run: gh issue create -l meeting -t "Community SIG Meeting, ${{ github.event.inputs.time }} UTC ${{ github.event.inputs.date }} ${{ github.event.inputs.descSuffix }}" -F content.md - - setup-lets-talk-about-contrib-stream: - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Setup Lets talk about contributing live stream - runs-on: ubuntu-latest - if: github.event.inputs.type == 'lets_talk_contrib' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Create issue content - uses: actions/github-script@v4 - with: - script: | - const { writeFileSync } = require('fs'); - const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/contributor-first.js'); - - const issueContent = getMeetingIssueContent('${{ github.event.inputs.time }}', '${{ github.event.inputs.everytimezone }}'); - - writeFileSync('content.md', issueContent, { encoding: 'utf8'}); - - name: Create issue with meeting details - run: gh issue create -l meeting -t "Let's talk about contributing, ${{ github.event.inputs.time }} UTC ${{ github.event.inputs.date }} ${{ github.event.inputs.descSuffix }}" -F content.md - - setup-spec-3-0-meeting: - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Setup meeting about 3.0 spec work - runs-on: ubuntu-latest - if: github.event.inputs.type == 'spec3-0' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Create issue content - uses: actions/github-script@v4 - with: - script: | - const { writeFileSync } = require('fs'); - const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/spec-3-0.js'); - - const issueContent = getMeetingIssueContent('${{ github.event.inputs.time }}', '${{ github.event.inputs.everytimezone }}'); - - writeFileSync('content.md', issueContent, { encoding: 'utf8'}); - - name: Create issue with meeting details - run: gh issue create -l meeting -t "Spec 3.0 Meeting, ${{ github.event.inputs.time }} UTC ${{ github.event.inputs.date }} ${{ github.event.inputs.descSuffix }}" -F content.md diff --git a/.github/workflows/event_issue_templates/index.js b/.github/workflows/event_issue_templates/index.js new file mode 100644 index 000000000..9de4456c9 --- /dev/null +++ b/.github/workflows/event_issue_templates/index.js @@ -0,0 +1,28 @@ +const { writeFileSync } = require('fs'); +const { getMeetingIssueContent } = require('./meetings/community.js'); +const { parseDate } = require('./utils/date.js'); + +/** + * @param {string} date Date as YYYY-MM-DD + * @param {string} time Number that represents hour, 2-digit format + * @param {string} code Entire core package helper + * @param {string} getMeetingIssueContent Function that returns content of the meeting issue +*/ +module.exports = (date, time, core, getMeetingIssueContent) => { + + core.info(`Workflow triggered with the following hour ${time} and date ${date}`); + const dateDetails = parseDate(`${ date }T${ time }:00:00Z`); + + core.info('This is how time and date looks like after parsing:'); + core.info(JSON.stringify(dateDetails)); + + if (dateDetails === 'Invalid Date') core.setFailed('Invalid date of the event. Make sure that you provided correct hour of the meeting and date in a format described in the meeting input form.') + + const issueContent = getMeetingIssueContent(dateDetails.hour, dateDetails.formattedDate); + + writeFileSync('content.md', issueContent, { encoding: 'utf8'}); + + core.setOutput('formattedDate', dateDetails.formattedDate); + core.setOutput('fullDate', dateDetails.fullDate); + core.setOutput('hour', dateDetails.hour); +} \ No newline at end of file diff --git a/.github/workflows/event_issue_templates/meetings/community.js b/.github/workflows/event_issue_templates/meetings/community.js new file mode 100644 index 000000000..32deabc6a --- /dev/null +++ b/.github/workflows/event_issue_templates/meetings/community.js @@ -0,0 +1,28 @@ +module.exports.getMeetingIssueContent = (time, date) => { + + return `This is the AsyncAPI Community meeting. You're invited to [join us live on Zoom](https://zoom.us/j/165106914) and ask questions. **The meeting takes place on alternate Tuesdays**. Recordings from the previous meetings are available in [this](https://www.youtube.com/playlist?list=PLbi1gRlP7pijUwZJErzyYf_Rc-PWu4lXS) playlist on YouTube. + +**This time we meet at ${time}:00 UTC. Check what time is it in your time zone with [time zone converter](https://dateful.com/convert/coordinated-universal-time-utc?t=${time}&d=${date})** + +Join [this](https://groups.google.com/forum/#!forum/asyncapi-users) mailing list to get an always-up-to-date invite to the meeting in your calendar. You can also check [AsyncAPI Calendar](https://calendar.google.com/calendar/u/0/embed?src=tbrbfq4de5bcngt8okvev4lstk@group.calendar.google.com). + +## Agenda + +> Don't wait for the meeting to discuss topics that already have issues. Feel free to comment on them earlier. + +1. Q&A +1. _Place for your topic_ +1. Q&A + +## Notes + +tbd + +## Chat + +tbd + +## Recording + +tbd` +} \ No newline at end of file diff --git a/.github/workflows/event_issue_templates/contributor-first.js b/.github/workflows/event_issue_templates/meetings/lets-talk-about-contrib.js similarity index 83% rename from .github/workflows/event_issue_templates/contributor-first.js rename to .github/workflows/event_issue_templates/meetings/lets-talk-about-contrib.js index c80f6ed80..38c1f9df6 100644 --- a/.github/workflows/event_issue_templates/contributor-first.js +++ b/.github/workflows/event_issue_templates/meetings/lets-talk-about-contrib.js @@ -1,10 +1,10 @@ -module.exports.getMeetingIssueContent = (time, everytimezone) => { +module.exports.getMeetingIssueContent = (time, date) => { return `The purpose of this meeting is to focus on contributors, focus on people that want to contribute to AsyncAPI Initiative but do not know how to do it. AsyncAPI Initiative is a large project, with lots of code, lots of docs, and many many other areas that need help, but it is not easy to start. Recordings from the previous meetings are available in [this](https://www.youtube.com/playlist?list=PLbi1gRlP7pigPBrBMaNQhUeniR1pdDMiY) playlist on YouTube. -**This time we meet at [${time} UTC](${everytimezone})** +**This time we meet at ${time}:00 UTC. Check what time is it in your time zone with [time zone converter](https://dateful.com/convert/coordinated-universal-time-utc?t=${time}&d=${date})** Join [this](https://groups.google.com/forum/#!forum/asyncapi-users) mailing list to get an always-up-to-date invite to the meeting in your calendar. You can also check [AsyncAPI Calendar](https://calendar.google.com/calendar/u/0/embed?src=tbrbfq4de5bcngt8okvev4lstk@group.calendar.google.com). diff --git a/.github/workflows/event_issue_templates/spec-3-0.js b/.github/workflows/event_issue_templates/meetings/spec-3-0.js similarity index 83% rename from .github/workflows/event_issue_templates/spec-3-0.js rename to .github/workflows/event_issue_templates/meetings/spec-3-0.js index dba2fa448..4dadd7500 100644 --- a/.github/workflows/event_issue_templates/spec-3-0.js +++ b/.github/workflows/event_issue_templates/meetings/spec-3-0.js @@ -1,10 +1,10 @@ -module.exports.getMeetingIssueContent = (time, everytimezone) => { +module.exports.getMeetingIssueContent = (time, date) => { return `This is the meeting for community member involved in works related to 3.0 release of AsyncAPI Specification. **The meeting takes place bi-weekly on Wednesdays**. First and third week every month until release. Recordings from the previous meetings are available in [this](https://www.youtube.com/playlist?list=PLbi1gRlP7pihClJY-kXuTRRJ8n1awb0VV) playlist on YouTube. -**This time we meet at [${time} UTC](${everytimezone})** +**This time we meet at ${time}:00 UTC. Check what time is it in your time zone with [time zone converter](https://dateful.com/convert/coordinated-universal-time-utc?t=${time}&d=${date})** Join [this mailing list](https://groups.google.com/forum/#!forum/asyncapi-users) to get an always-up-to-date invite to the meeting in your calendar. You can also check [AsyncAPI Calendar](https://calendar.google.com/calendar/u/0/embed?src=tbrbfq4de5bcngt8okvev4lstk@group.calendar.google.com). diff --git a/.github/workflows/event_issue_templates/sig.js b/.github/workflows/event_issue_templates/sig.js deleted file mode 100644 index cf7206c0d..000000000 --- a/.github/workflows/event_issue_templates/sig.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports.getMeetingIssueContent = (time, everytimezone) => { - - return `This is the meeting for the AsyncAPI Special Interest Group (SIG). You're invited to [join us](https://zoom.us/j/165106914) and ask questions. **The meeting takes place on alternate Tuesdays**. Recordings from the previous meetings are available in [this](https://www.youtube.com/playlist?list=PLbi1gRlP7pijUwZJErzyYf_Rc-PWu4lXS) playlist on YouTube. - -**This time we meet at [${time} UTC](${everytimezone})** - -Join [this](https://groups.google.com/forum/#!forum/asyncapi-users) mailing list to get an always-up-to-date invite to the meeting in your calendar. You can also check [AsyncAPI Calendar](https://calendar.google.com/calendar/u/0/embed?src=tbrbfq4de5bcngt8okvev4lstk@group.calendar.google.com). - -## Agenda - -> Don't wait for the meeting to discuss topics that already have issues. Feel free to comment on them earlier. - -1. Q&A -1. _Place for your topic_ -1. Q&A - -## Notes - -tbd - -## Chat - -tbd - -## Recording - -tbd` -} \ No newline at end of file diff --git a/.github/workflows/event_issue_templates/utils/README.md b/.github/workflows/event_issue_templates/utils/README.md new file mode 100644 index 000000000..4a31c9a22 --- /dev/null +++ b/.github/workflows/event_issue_templates/utils/README.md @@ -0,0 +1 @@ +Instead of using `package.json` and building complex build system for scripts that setup AsyncAPI meetings, we keep source code of minified [day.js](https://github.com/iamkun/dayjs) and its UTC-format plugin here in `utils` folder directly. This scripts run on CI, and are not vulerable so do not need `package.json` and regular security updates. \ No newline at end of file diff --git a/.github/workflows/event_issue_templates/utils/date.js b/.github/workflows/event_issue_templates/utils/date.js new file mode 100644 index 000000000..295975b35 --- /dev/null +++ b/.github/workflows/event_issue_templates/utils/date.js @@ -0,0 +1,19 @@ +const dayjs = require('./dayjs.min.js'); +const utc = require('./utc.js'); +dayjs.extend(utc); + +/** + * @param {string} date Date as 2019-01-25T08:00:00Z +*/ +module.exports.parseDate = (date) => { + + const meetingDate = dayjs(date); + const formattedDate = meetingDate.utc().format('YYYY-MM-DD'); + const fullDate = meetingDate.utc().format('dddd MMMM D YYYY'); + const hour = meetingDate.utc().format('H'); + + return { formattedDate, fullDate, hour } +} + + + diff --git a/.github/workflows/event_issue_templates/utils/dayjs.min.js b/.github/workflows/event_issue_templates/utils/dayjs.min.js new file mode 100644 index 000000000..50c5278a3 --- /dev/null +++ b/.github/workflows/event_issue_templates/utils/dayjs.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)