Skip to content

Commit

Permalink
* For files not in tpac2024-meetings workflows, updated setup-node to…
Browse files Browse the repository at this point in the history
… v4 and node-version to 20 (per tpac2024-meetings workflows)

* For files in tpac2024-meetings workflows, copied them here.
  • Loading branch information
ianbjacobs committed May 28, 2024
1 parent 4354abb commit b71caaf
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 58 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/add-minutes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Link to session minutes
name: [M] Link to session minutes

on:
workflow_dispatch:
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/init-labels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Initialize labels
name: [M] Initialize labels

on:
workflow_dispatch:
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/setup-irc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Setup IRC channels
name: [M] Setup IRC channels

on:
workflow_dispatch:
Expand All @@ -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

Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/suggest-grid.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 9 additions & 10 deletions .github/workflows/update-calendar.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update TPAC calendar based on sessions info
name: "[M] Update W3C calendar"

on:
workflow_dispatch:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}

21 changes: 10 additions & 11 deletions .github/workflows/validate-grid.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate breakout session grid
name: "[M] Validate all sessions"

on:
workflow_dispatch:
Expand All @@ -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
Expand All @@ -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 }}

21 changes: 10 additions & 11 deletions .github/workflows/validate-session-manual.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Manually validate breakout session issue
name: "[M] Validate a session"

on:
workflow_dispatch:
Expand All @@ -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
Expand All @@ -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 }}

26 changes: 12 additions & 14 deletions .github/workflows/validate-session.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate breakout session issue and update calendar
name: "[A] Validate session and update W3C calendar"

on:
issues:
Expand All @@ -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' }}
Expand All @@ -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
Expand All @@ -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' }}
Expand All @@ -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' }}
Expand All @@ -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 }}
Loading

0 comments on commit b71caaf

Please sign in to comment.