diff --git a/.github/workflows/add-minutes.yml b/.github/workflows/add-minutes.yml index 09c09a9..a0654cf 100644 --- a/.github/workflows/add-minutes.yml +++ b/.github/workflows/add-minutes.yml @@ -1,4 +1,4 @@ -name: Link to session minutes +name: [M] Link to session minutes on: workflow_dispatch: @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main diff --git a/.github/workflows/init-labels.yml b/.github/workflows/init-labels.yml index fe6e9fb..b211423 100644 --- a/.github/workflows/init-labels.yml +++ b/.github/workflows/init-labels.yml @@ -1,4 +1,4 @@ -name: Initialize labels +name: [M] Initialize labels on: workflow_dispatch: @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main diff --git a/.github/workflows/setup-irc.yml b/.github/workflows/setup-irc.yml index a5a6cdc..db5f363 100644 --- a/.github/workflows/setup-irc.yml +++ b/.github/workflows/setup-irc.yml @@ -1,4 +1,4 @@ -name: Setup IRC channels +name: [M] Setup IRC channels on: workflow_dispatch: @@ -23,12 +23,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main diff --git a/.github/workflows/suggest-grid.yml b/.github/workflows/suggest-grid.yml new file mode 100644 index 0000000..65efc4e --- /dev/null +++ b/.github/workflows/suggest-grid.yml @@ -0,0 +1,84 @@ +name: "[M] Create a schedule" + +on: + workflow_dispatch: + inputs: + preservelist: + description: 'Space-separated (no comma!) list of session numbers whose meetings must be preserved. Or "all" to preserve all meetings. Or "none" to ignore existing meetings.' + required: true + default: 'all' + type: string + exceptlist: + description: 'Only makes sense when previous value is "all"! Space-separated (no comma!) list of session numbers whose meetings are to be discarded. Or "none" to mean "preserve all meetings".' + required: true + default: 'none' + type: string + apply: + description: 'Whether to suggest a schedule (default) or apply it.' + required: true + default: 'suggest' + type: choice + options: + - suggest + - apply + seed: + description: 'The seed to use to shuffle the array of sessions initially.' + default: '' + type: string + +jobs: + suggest-grid: + name: Create a schedule + runs-on: ubuntu-latest + steps: + - name: Setup node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Checkout latest version of release script + uses: actions/checkout@v4 + with: + ref: main + + - name: Install dependencies + run: npm ci + + - name: Create directory to store result + run: mkdir .schedule + + - name: Create a schedule + # Note the use of YAML "folded style" (through `>`) to split the + # command into multiple lines, and of the ternary like operator to set + # CLI parameters correctly. For details, see: + # https://yaml-multiline.info/ + # https://docs.github.com/en/actions/learn-github-actions/expressions#example + run: > + npx tpac-breakouts schedule + --preserve ${{ inputs.preservelist }} + --except ${{ inputs.exceptlist }} + ${{ inputs.seed && format('--seed {0}', inputs.seed) || '' }} + ${{ inputs.apply == 'apply' && ' --apply' || '' }} > .schedule/index.html + env: + # URL of the annual TPAC XXXX breakout project. + # The PROJECT_OWNER and PROJECT_NUMBER variables must be defined on + # the repository. PROJECT_OWNER_TYPE needs to be set to "user" if + # project belongs to a user. It may be omitted otherwise (or set to + # 'org"'). + PROJECT_OWNER: ${{ vars.PROJECT_OWNER_TYPE || 'organization' }}/${{ vars.PROJECT_OWNER || 'w3c' }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + + # Same valid Personal Access Token (classic version) as above, with + # project and public_repo scope. + GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + + # Mapping between chair GitHub identities and W3C IDs must be stored + # in a variable. Structure is a JSON object with identities as keys. + W3CID_MAP: ${{ vars.W3CID_MAP }} + + - name: Create ZIP artifact + uses: actions/upload-artifact@v4 + with: + name: schedule + path: .schedule diff --git a/.github/workflows/update-calendar.yml b/.github/workflows/update-calendar.yml index 0dddbce..2974c51 100644 --- a/.github/workflows/update-calendar.yml +++ b/.github/workflows/update-calendar.yml @@ -1,4 +1,4 @@ -name: Update TPAC calendar based on sessions info +name: "[M] Update W3C calendar" on: workflow_dispatch: @@ -20,26 +20,24 @@ on: jobs: update-calendar: - name: Update TPAC calendar + name: Update W3C calendar runs-on: ubuntu-latest steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main - # Note: no "package-lock.json" and no "npm ci" on purpose to retrieve - # latest version of w3c/tpac-breakouts tools (which are unversioned) - name: Install dependencies - run: npm install + run: npm ci - name: Convert session issues to calendar entries. - run: npx update-calendar ${{ inputs.sessionNumber }} ${{ inputs.calendarstatus }} + run: npx tpac-breakouts sync-calendar ${{ inputs.sessionNumber }} --status ${{ inputs.calendarstatus }} env: # URL of the annual TPAC XXXX breakout project. # The PROJECT_OWNER and PROJECT_NUMBER variables must be defined on @@ -52,6 +50,7 @@ jobs: # A valid Personal Access Token (classic version) with project # and public_repo scope. GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} # Information about the team user on behalf of which the updates to # the calendar will be made. The password must obviously be stored @@ -66,5 +65,5 @@ jobs: # Mapping between chair GitHub identities and W3C IDs must be stored # in a variable. Structure is a JSON object with identities as keys. - CHAIR_W3CID: ${{ vars.CHAIR_W3CID }} + W3CID_MAP: ${{ vars.W3CID_MAP }} diff --git a/.github/workflows/validate-grid.yml b/.github/workflows/validate-grid.yml index 995a8ef..1eaf14e 100644 --- a/.github/workflows/validate-grid.yml +++ b/.github/workflows/validate-grid.yml @@ -1,4 +1,4 @@ -name: Validate breakout session grid +name: "[M] Validate all sessions" on: workflow_dispatch: @@ -14,26 +14,24 @@ on: jobs: validate-grid: - name: Validate breakout session grid + name: Validate session grid runs-on: ubuntu-latest steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main - # Note: no "package-lock.json" and no "npm ci" on purpose to retrieve - # latest version of w3c/tpac-breakouts tools (which are unversioned) - name: Install dependencies - run: npm install + run: npm ci - - name: Validate grid and update issue labels accordingly - run: npx validate-grid ${{ inputs.validation }} + - name: Validate grid and update project fields + run: npx tpac-breakouts validate all --what ${{ inputs.validation }} env: # URL of the annual TPAC XXXX breakout project. # The PROJECT_OWNER and PROJECT_NUMBER variables must be defined on @@ -46,8 +44,9 @@ jobs: # A valid Personal Access Token (classic version) with project # and public_repo scope. GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} # Mapping between chair GitHub identities and W3C IDs must be stored # in a variable. Structure is a JSON object with identities as keys. - CHAIR_W3CID: ${{ vars.CHAIR_W3CID }} + W3CID_MAP: ${{ vars.W3CID_MAP }} diff --git a/.github/workflows/validate-session-manual.yml b/.github/workflows/validate-session-manual.yml index bdec123..29760d3 100644 --- a/.github/workflows/validate-session-manual.yml +++ b/.github/workflows/validate-session-manual.yml @@ -1,4 +1,4 @@ -name: Manually validate breakout session issue +name: "[M] Validate a session" on: workflow_dispatch: @@ -10,26 +10,24 @@ on: jobs: validate-session: - name: Validate breakout session + name: Validate session runs-on: ubuntu-latest steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main - # Note: no "package-lock.json" and no "npm ci" on purpose to retrieve - # latest version of w3c/tpac-breakouts tools (which are unversioned) - name: Install dependencies - run: npm install + run: npm ci - - name: Validate session and update issue labels accordingly - run: npx validate-session ${{ inputs.sessionNumber }} + - name: Validate session and update project fields + run: npx tpac-breakouts validate ${{ inputs.sessionNumber }} --what everything env: # URL of the annual TPAC XXXX breakout project. # The PROJECT_OWNER and PROJECT_NUMBER variables must be defined on @@ -42,8 +40,9 @@ jobs: # Same valid Personal Access Token (classic version) as above, with # project and public_repo scope. GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} # Mapping between chair GitHub identities and W3C IDs must be stored # in a variable. Structure is a JSON object with identities as keys. - CHAIR_W3CID: ${{ vars.CHAIR_W3CID }} + W3CID_MAP: ${{ vars.W3CID_MAP }} diff --git a/.github/workflows/validate-session.yml b/.github/workflows/validate-session.yml index 7b75946..f16f081 100644 --- a/.github/workflows/validate-session.yml +++ b/.github/workflows/validate-session.yml @@ -1,4 +1,4 @@ -name: Validate breakout session issue and update calendar +name: "[A] Validate session and update W3C calendar" on: issues: @@ -14,25 +14,23 @@ on: jobs: validate-session: - name: Validate breakout session + name: Validate session and update W3C calendar runs-on: ubuntu-latest # We're only interested in "session" issues if: ${{ contains(github.event.issue.labels.*.name, 'session') }} steps: - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Checkout latest version of release script - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main - # Note: no "package-lock.json" and no "npm ci" on purpose to retrieve - # latest version of w3c/tpac-breakouts tools (which are unversioned) - name: Install dependencies - run: npm install + run: npm ci - name: Add issue to TPAC breakout session project if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }} @@ -56,10 +54,10 @@ jobs: github-token: ${{ secrets.GRAPHQL_TOKEN }} - name: Add thank you comment with links to documentation - if: ${{ github.event.action == 'opened' }} + if: ${{ false && github.event.action == 'opened' }} run: gh issue comment "$NUMBER" --body-file "$BODY_FILE" env: - GITHUB_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} BODY_FILE: .github/session-created.md @@ -69,7 +67,7 @@ jobs: shell: bash - name: Validate session and update issue labels accordingly - run: npx validate-session ${{ github.event.issue.number }} changes.json + run: npx tpac-breakouts validate ${{ github.event.issue.number }} --changes changes.json --what everything env: # See above for PROJECT_XX variables PROJECT_OWNER: ${{ vars.PROJECT_OWNER_TYPE || 'organization' }}/${{ vars.PROJECT_OWNER || 'w3c' }} @@ -81,10 +79,10 @@ jobs: # Mapping between chair GitHub identities and W3C IDs must be stored # in a variable. Structure is a JSON object with identities as keys. - CHAIR_W3CID: ${{ vars.CHAIR_W3CID }} + W3CID_MAP: ${{ vars.W3CID_MAP }} - name: Create/Update calendar entry - run: npx update-calendar ${{ github.event.issue.number }} quiet + run: npx tpac-breakouts sync-calendar ${{ github.event.issue.number }} --quiet env: # See above for PROJECT_XX variables PROJECT_OWNER: ${{ vars.PROJECT_OWNER_TYPE || 'organization' }}/${{ vars.PROJECT_OWNER || 'w3c' }} @@ -107,4 +105,4 @@ jobs: # Mapping between chair GitHub identities and W3C IDs must be stored # in a variable. Structure is a JSON object with identities as keys. - CHAIR_W3CID: ${{ vars.CHAIR_W3CID }} + W3CID_MAP: ${{ vars.W3CID_MAP }} diff --git a/.github/workflows/view-event.yml b/.github/workflows/view-event.yml new file mode 100644 index 0000000..c5ea431 --- /dev/null +++ b/.github/workflows/view-event.yml @@ -0,0 +1,51 @@ +name: "[M] View current schedule" + +on: + workflow_dispatch: + +jobs: + view-event: + name: View the current schedule + runs-on: ubuntu-latest + steps: + - name: Setup node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Checkout latest version of release script + uses: actions/checkout@v4 + with: + ref: main + + - name: Install dependencies + run: npm ci + + - name: Create directory to store result + run: mkdir .schedule + + - name: Generate the HTML page + run: npx tpac-breakouts view --format html > .schedule/index.html + env: + # URL of the annual TPAC XXXX breakout project. + # The PROJECT_OWNER and PROJECT_NUMBER variables must be defined on + # the repository. PROJECT_OWNER_TYPE needs to be set to "user" if + # project belongs to a user. It may be omitted otherwise (or set to + # 'org"'). + PROJECT_OWNER: ${{ vars.PROJECT_OWNER_TYPE || 'organization' }}/${{ vars.PROJECT_OWNER || 'w3c' }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + + # Same valid Personal Access Token (classic version) as above, with + # project and public_repo scope. + GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + + # Mapping between chair GitHub identities and W3C IDs must be stored + # in a variable. Structure is a JSON object with identities as keys. + W3CID_MAP: ${{ vars.W3CID_MAP }} + + - name: Create ZIP artifact + uses: actions/upload-artifact@v4 + with: + name: schedule + path: .schedule