2021-04-08 02:15:11 +02:00
|
|
|
name: Publish Releases
|
2020-11-28 12:34:36 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-01-15 22:47:00 +02:00
|
|
|
- master
|
2020-11-28 12:34:36 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-06-29 12:07:50 +02:00
|
|
|
sanity-check:
|
|
|
|
name: Pre-publish checks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-05-02 23:24:43 +02:00
|
|
|
- name: Use Node.js
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: actions/setup-node@v4
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
2024-07-23 03:56:39 +02:00
|
|
|
node-version: 22
|
2024-03-09 18:28:21 +02:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: '**/package.json'
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Install dependencies
|
2024-03-18 23:27:08 +02:00
|
|
|
run: npm i --ignore-scripts --no-audit --no-fund
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Run linters
|
|
|
|
run: npm run lint
|
2021-10-31 12:38:10 +02:00
|
|
|
- name: Build NodeJS package
|
|
|
|
run: npm run build
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: npm run test
|
2020-11-28 12:34:36 +02:00
|
|
|
npm:
|
|
|
|
name: NPM Package
|
2021-06-29 12:07:50 +02:00
|
|
|
needs: sanity-check
|
2020-11-28 12:34:36 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-05-02 23:24:43 +02:00
|
|
|
- name: Use Node.js
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: actions/setup-node@v4
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
2024-07-23 03:56:39 +02:00
|
|
|
node-version: 22
|
2024-03-09 18:28:21 +02:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: '**/package.json'
|
2023-10-28 21:31:47 +02:00
|
|
|
- id: get-version
|
2023-11-05 21:35:53 +02:00
|
|
|
uses: ./.github/actions/get-version
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Install dependencies
|
2024-03-18 23:27:08 +02:00
|
|
|
run: npm i --ignore-scripts --no-audit --no-fund
|
2024-02-11 06:52:10 +02:00
|
|
|
- name: Reformat to regular markdown
|
2024-04-21 14:16:09 +02:00
|
|
|
run: node scripts/release/reformat-markdown.js "${{ steps.get-version.outputs.version }}"
|
2023-08-01 20:09:47 +02:00
|
|
|
- name: Update SDK Typescript definitions
|
2024-04-21 14:16:09 +02:00
|
|
|
run: node scripts/release/update-sdk-ts-defs.js
|
2024-10-01 05:52:48 +02:00
|
|
|
- name: Minify icons data file
|
|
|
|
run: node scripts/release/minify-icons-data.js
|
2023-04-30 16:45:25 +02:00
|
|
|
- name: Build NodeJS package
|
|
|
|
run: npm run build
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Deploy to NPM
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: JS-DevTools/npm-publish@v3
|
2021-01-15 22:47:00 +02:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
2020-11-28 12:34:36 +02:00
|
|
|
github:
|
|
|
|
name: GitHub release
|
2021-06-29 12:07:50 +02:00
|
|
|
needs: sanity-check
|
2020-11-28 12:34:36 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
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-01-15 22:47:00 +02:00
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Get commit message (for release title and body)
|
|
|
|
id: commit
|
2024-03-14 16:42:22 +02:00
|
|
|
uses: kceb/git-message-action@v3
|
2023-10-28 21:31:47 +02:00
|
|
|
- id: get-version
|
2023-11-05 21:35:53 +02:00
|
|
|
uses: ./.github/actions/get-version
|
2024-02-11 06:52:10 +02:00
|
|
|
- name: Reformat to regular markdown
|
2024-04-21 14:16:09 +02:00
|
|
|
run: node scripts/release/reformat-markdown.js "${{ steps.get-version.outputs.version }}"
|
2022-04-18 14:56:17 +02:00
|
|
|
- name: Configure GIT credentials
|
|
|
|
run: |
|
2024-03-26 23:58:59 +02:00
|
|
|
git config user.name "simple-icons[bot]"
|
|
|
|
git config user.email "simple-icons[bot]@users.noreply.github.com"
|
2022-04-18 14:56:17 +02:00
|
|
|
# Commit that will only be included in the tag
|
2023-08-01 20:09:47 +02:00
|
|
|
- name: Commit CDN theme image links removal
|
2022-01-09 23:04:36 +02:00
|
|
|
run: |
|
|
|
|
git add README.md
|
2023-07-30 23:08:20 +02:00
|
|
|
git commit -m 'Replace README CDN theme image links'
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Create and push git tag
|
2022-04-18 14:56:17 +02:00
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
tag="${{ steps.get-version.outputs.version }}"
|
|
|
|
git tag -a "${tag}" -m "${{ steps.commit.outputs.git-message }}"
|
|
|
|
git push origin "${tag}"
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Create release
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: softprops/action-gh-release@v2
|
2021-01-15 22:47:00 +02:00
|
|
|
env:
|
2024-04-07 11:47:28 +02:00
|
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
2021-01-15 22:47:00 +02:00
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.get-version.outputs.version }}
|
2024-03-09 18:28:21 +02:00
|
|
|
name: ${{ steps.commit.outputs.title }}
|
2021-08-29 18:59:33 +02:00
|
|
|
body: ${{ steps.commit.outputs.body }}
|
2021-01-01 20:29:47 +02:00
|
|
|
font:
|
|
|
|
name: Trigger simple-icons-font release
|
|
|
|
needs: npm
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
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 }}
|
2024-03-31 10:37:43 +02:00
|
|
|
repositories: 'simple-icons-font'
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Trigger simple-icons-font release
|
|
|
|
run: |
|
|
|
|
curl -X POST \
|
2024-03-28 23:31:27 +02:00
|
|
|
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
|
2021-01-15 22:47:00 +02:00
|
|
|
-d '{"ref":"develop"}' \
|
|
|
|
https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches
|
2021-01-18 14:18:02 +02:00
|
|
|
website:
|
|
|
|
name: Trigger simple-icons-website update
|
|
|
|
needs: npm
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
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 }}
|
2024-03-31 10:37:43 +02:00
|
|
|
repositories: 'simple-icons-website'
|
2021-01-18 14:18:02 +02:00
|
|
|
- name: Trigger simple-icons-website update
|
|
|
|
run: |
|
|
|
|
curl -X POST \
|
2024-03-28 23:31:27 +02:00
|
|
|
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
|
2021-01-18 14:18:02 +02:00
|
|
|
-d '{"ref":"master"}' \
|
|
|
|
https://api.github.com/repos/simple-icons/simple-icons-website/actions/workflows/auto-release.yml/dispatches
|