2021-04-08 02:15:11 +02:00
|
|
|
name: Create Release Pull Request
|
2020-12-14 15:06:01 +02:00
|
|
|
on:
|
2021-10-07 10:41:38 +02:00
|
|
|
# THIS WORKFLOW SHOULD NEVER BE TRIGGERED ON A PUSH EVENT. IF TRIGGERED ON A
|
|
|
|
# PUSH EVENT IT MAY CREATE AN ENDLESS STREAM OF 'version bump' COMMITS.
|
2021-06-15 23:50:14 +02:00
|
|
|
workflow_dispatch:
|
2020-12-14 15:06:01 +02:00
|
|
|
schedule:
|
|
|
|
# "At 00:00 on Sunday" (https://crontab.guru/once-a-week)
|
2021-10-25 21:13:10 +02:00
|
|
|
- cron: '0 0 * * 0'
|
2020-12-14 15:06:01 +02:00
|
|
|
|
2021-06-15 23:50:14 +02:00
|
|
|
# This Workflow can be triggered manually through the GitHub UI or API. For the
|
|
|
|
# API use the following request:
|
|
|
|
# curl -X POST \
|
|
|
|
# -H "Authorization: Bearer <token>" \
|
|
|
|
# -d '{"ref":"develop"}' \
|
|
|
|
# https://api.github.com/repos/simple-icons/simple-icons/actions/workflows/create-release.yml/dispatches
|
|
|
|
# Replacing <token> by a personal access token with scope `public_repo`
|
|
|
|
|
2020-12-14 15:06:01 +02:00
|
|
|
jobs:
|
2021-03-03 12:57:33 +02:00
|
|
|
release-pr:
|
2020-12-14 15:06:01 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-07 10:41:38 +02:00
|
|
|
if: github.event_name != 'push'
|
2021-03-03 12:57:33 +02:00
|
|
|
outputs:
|
|
|
|
did-create-pr: ${{ steps.release.outputs.did-create-pr }}
|
|
|
|
new-version: ${{ steps.release.outputs.new-version }}
|
2020-12-14 15:06:01 +02:00
|
|
|
steps:
|
2024-03-31 10:51:05 +02:00
|
|
|
- uses: actions/create-github-app-token@v1
|
|
|
|
id: app-token
|
|
|
|
with:
|
|
|
|
app-id: ${{ vars.BOT_APP_ID }}
|
|
|
|
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
|
2024-01-29 09:51:23 +02:00
|
|
|
- uses: simple-icons/release-action@v1
|
2021-03-03 12:57:33 +02:00
|
|
|
id: release
|
2021-01-15 22:47:00 +02:00
|
|
|
with:
|
2024-03-31 10:51:05 +02:00
|
|
|
repo-token: ${{ steps.app-token.outputs.token }}
|
2021-03-03 12:57:33 +02:00
|
|
|
version-bump:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: release-pr
|
2021-10-07 10:41:38 +02:00
|
|
|
if: |
|
|
|
|
github.event_name != 'push' &&
|
|
|
|
needs.release-pr.outputs.did-create-pr == 'true'
|
2021-03-03 12:57:33 +02:00
|
|
|
steps:
|
2024-03-28 23:31:27 +02:00
|
|
|
- uses: actions/create-github-app-token@v1
|
|
|
|
id: app-token
|
|
|
|
with:
|
|
|
|
app-id: ${{ vars.BOT_APP_ID }}
|
|
|
|
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
|
2021-03-03 12:57:33 +02:00
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-03-03 12:57:33 +02:00
|
|
|
with:
|
2021-10-07 10:41:38 +02:00
|
|
|
# Ensure the commit can be pushed regardless of branch protections (must belong to an admin of this repo)
|
2024-03-28 23:31:27 +02:00
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
2021-03-03 12:57:33 +02:00
|
|
|
# Ensure we are checked out on the develop branch
|
|
|
|
ref: develop
|
2023-09-17 22:56:03 +02:00
|
|
|
- name: Use Node.js 20.x
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: actions/setup-node@v4
|
2023-08-01 20:06:45 +02:00
|
|
|
with:
|
2024-03-09 18:28:21 +02:00
|
|
|
node-version: 20
|
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: '**/package.json'
|
2021-03-03 12:57:33 +02:00
|
|
|
- name: Bump version
|
2023-08-01 20:06:45 +02:00
|
|
|
run: |
|
|
|
|
npm version --no-commit-hooks --no-git-tag-version \
|
|
|
|
"${{ needs.release-pr.outputs.new-version }}"
|
|
|
|
- name: Install dependencies
|
2024-03-18 23:27:08 +02:00
|
|
|
run: npm i --ignore-scripts --no-audit --no-fund
|
2021-05-05 23:29:49 +02:00
|
|
|
- name: Update major version in CDN URLs
|
2024-03-24 19:38:18 +02:00
|
|
|
run: ./scripts/release/update-cdn-urls.js
|
2021-12-10 03:02:58 +02:00
|
|
|
- name: Update SVGs count milestone
|
2024-03-24 19:38:18 +02:00
|
|
|
run: ./scripts/release/update-svgs-count.js
|
2021-03-03 12:57:33 +02:00
|
|
|
- name: Update slugs table
|
2024-03-24 19:38:18 +02:00
|
|
|
run: ./scripts/release/update-slugs-table.js
|
2023-08-01 20:09:47 +02:00
|
|
|
- name: Update SDK Typescript definitions
|
2024-03-24 19:38:18 +02:00
|
|
|
run: ./scripts/release/update-sdk-ts-defs.js
|
2021-03-03 12:57:33 +02:00
|
|
|
- name: Commit version bump
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
2021-03-03 12:57:33 +02:00
|
|
|
with:
|
|
|
|
commit_message: version bump
|
2024-03-26 23:58:59 +02:00
|
|
|
commit_user_name: 'simple-icons[bot]'
|
|
|
|
commit_user_email: 'simple-icons[bot]@users.noreply.github.com'
|
|
|
|
commit_author: 'simple-icons[bot] <simple-icons[bot]@users.noreply.github.com>'
|