Skip to content

⏫ Promoting release 2409271652000 to Stable channel #697

⏫ Promoting release 2409271652000 to Stable channel

⏫ Promoting release 2409271652000 to Stable channel #697

name: Post promote tasks
on:
pull_request:
types:
- closed
branches:
- 'main'
paths:
- 'configs/versions.json'
workflow_dispatch:
inputs:
pull_number:
type: number
jobs:
setup:
if: github.event.pull_request.merged || github.event.inputs.pull_number
runs-on: ubuntu-latest
outputs:
npm: ${{ steps.get-tasks.outputs.npm }}
calendar: ${{ steps.get-tasks.outputs.calendar }}
tagger: ${{ steps.get-tasks.outputs.tagger }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Get tasks
id: get-tasks
run: npx tsx ./scripts/post-promote-tasks-job.ts --pull_number="${{ github.event.pull_request.number }}" --override_pull_number="${{ github.event.inputs.pull_number }}"
release-calendar:
needs: setup
if: needs.setup.outputs.calendar
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.setup.outputs.calendar) }}
fail-fast: false
steps:
- name: Create event on release calendar
uses: fjogeleit/http-request-action@v1
with:
url: '${{ secrets.CALENDAR_URI }}'
customHeaders: '{"Authorization": "Basic ${{ secrets.CALENDAR_TOKEN }}"}'
data: >
{
"release":
{
"name": "${{ matrix.includes.amp-version }}"
},
"promotion":
{
"releaseName": "${{ matrix.includes.amp-version }}",
"time": "${{ matrix.includes.time }}",
"channel": "${{ matrix.includes.channel }}"
}
}
release-tagger:
needs: setup
if: needs.setup.outputs.tagger
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.setup.outputs.tagger) }}
fail-fast: false
steps:
- name: Trigger release tagger workflow on amphtml
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.github.com/repos/ampproject/amphtml/actions/workflows/release-tagger.yml/dispatches'
bearerToken: ${{ secrets.ACCESS_TOKEN }}
data: >
{
"ref": "main",
"inputs":
{
"action": "${{ matrix.includes.action }}",
"head": "${{ matrix.includes.head }}",
"base": "${{ matrix.includes.base }}",
"channel": "${{ matrix.includes.channel }}",
"sha": "${{ matrix.includes.sha }}"
}
}
create-issue-on-error:
if: failure()
needs: [setup, release-calendar, release-tagger]
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Create issue on error
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/create_issue_on_error.md
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
WORKFLOW_NAME: ${{ github.workflow }}
MENTION: '@ampproject/wg-infra'
REPO_SLUG: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}