diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 7346f16..f636c61 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: token: ${{ secrets.RB_TOKEN }} @@ -29,7 +29,7 @@ jobs: run: sudo apt-get update && sudo apt-get install -y libjpeg-dev zlib1g-dev - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.13' diff --git a/.github/workflows/plan-release.yml b/.github/workflows/plan-release.yml new file mode 100644 index 0000000..02aa8ef --- /dev/null +++ b/.github/workflows/plan-release.yml @@ -0,0 +1,94 @@ +# Manually triggered workflow that plans a new stable release: +# - creates a branch from main +# - runs `just plan ` +# - runs `just backfill ` +# - regenerates all derived files with `just` +# - pushes the branch and opens a PR against main + +name: Plan release + +on: + workflow_dispatch: + inputs: + release: + description: 'Release name (e.g. stable2606)' + required: true + type: string + node_version: + description: 'Node version (e.g. 1.25.0)' + required: true + type: string + cutoff-date: + description: 'Release cutoff date (YYYY-MM-DD) should be 1.5 months earlier than release date' + required: true + type: string + first-patch-date: + description: 'First patch release date (YYYY-MM-DD, must be a Monday) should be approx. 1 month after release date in a week where no releases are planned' + required: true + type: string + +permissions: + contents: write + pull-requests: write + +jobs: + plan-release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + token: ${{ secrets.RB_TOKEN }} + + - name: Install system dependencies for Pillow + run: sudo apt-get update && sudo apt-get install -y libjpeg-dev zlib1g-dev + + - name: Set up Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: '3.13' + + - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 + with: + just-version: 1.35.0 + + - name: Create release branch + env: + RELEASE: ${{ inputs.release }} + run: | + git config user.email "action@github.com" + git config user.name "GitHub Action" + git checkout -b "plan-${RELEASE}" + + - name: Plan release, backfill patches and regenerate files + env: + RELEASE: ${{ inputs.release }} + NODE_VERSION: ${{ inputs.node_version}} + CUTOFF_DATE: ${{ inputs.cutoff-date }} + FIRST_PATCH_DATE: ${{ inputs.first-patch-date }} + run: | + just plan "${RELEASE}" "${CUTOFF_DATE}" "${NODE_VERSION}" + just backfill "${RELEASE}" "${FIRST_PATCH_DATE}" + just + + - name: Commit and push + env: + RELEASE: ${{ inputs.release }} + run: | + git add . + git commit -m "Plan ${RELEASE}" + git push --set-upstream origin "plan-${RELEASE}" + + - name: Open pull request + env: + GH_TOKEN: ${{ secrets.RB_TOKEN }} + RELEASE: ${{ inputs.release }} + NODE_VERSION: ${{ inputs.node_version}} + CUTOFF_DATE: ${{ inputs.cutoff-date }} + FIRST_PATCH_DATE: ${{ inputs.first-patch-date }} + run: | + gh pr create \ + --base main \ + --head "plan-${RELEASE}" \ + --title "Plan ${RELEASE}" \ + --body "Plan and backfill for ${RELEASE} with node version ${NODE_VERSION} and cutoff date ${CUTOFF_DATE} and first patch date ${FIRST_PATCH_DATE}" diff --git a/.github/workflows/update-files.yml b/.github/workflows/update-files.yml index 33cb1dd..6518817 100644 --- a/.github/workflows/update-files.yml +++ b/.github/workflows/update-files.yml @@ -18,17 +18,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Install system dependencies for Pillow run: sudo apt-get update && sudo apt-get install -y libjpeg-dev zlib1g-dev - name: Set up Python - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.13' - - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff #v3.0.0 + - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 with: just-version: 1.35.0 diff --git a/README.md b/README.md index bb66b8d..071c200 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,8 @@ python3 scripts/manage.py backfill-patches stable2407 --start-date 2024-07-29 Then update the README to see the changes by running `just`. +Alternatively, this can be done entirely on GitHub: trigger the **Plan release** workflow (`.github/workflows/plan-release.yml`) from the Actions tab. It takes the release name, node version, cutoff date and first patch date as inputs, runs the `plan` and `backfill` commands, regenerates all derived files, and opens a PR against `main`. + ### Release Cutoff / Publish Run this command to cut off a release: @@ -134,6 +136,8 @@ python3 scripts/manage.py release cutoff stable2407-2 2024-09-02 With `publish` likewise. +Publishing can also be done on GitHub: trigger the **New release** workflow (`.github/workflows/new-release.yml`) from the Actions tab. It takes the release name and date as inputs, runs the `publish` command, regenerates all derived files, and opens a PR against `main`. + ## Automation Two scripts are currently in place to: