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
|
2023-09-17 22:56:03 +02:00
|
|
|
- name: Use Node.js 20.x
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
2023-09-17 22:56:03 +02:00
|
|
|
node-version: 20.x
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Cache dependencies
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 19:21:03 +02:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 12:07:50 +02:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install dependencies
|
2021-08-23 19:21:03 +02:00
|
|
|
run: npm i
|
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
|
2023-09-17 22:56:03 +02:00
|
|
|
- name: Use Node.js 20.x
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-01-15 22:47:00 +02:00
|
|
|
with:
|
2023-09-17 22:56:03 +02:00
|
|
|
node-version: 20.x
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Cache dependencies
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 19:21:03 +02:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 12:07:50 +02:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
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
|
2021-08-23 19:21:03 +02:00
|
|
|
run: npm i
|
2023-11-27 12:50:10 +02:00
|
|
|
- name: Reformat README to regular markdown
|
|
|
|
run: node ./scripts/release/reformat-readme.js "${{ steps.get-version.outputs.version }}"
|
2023-08-01 20:09:47 +02:00
|
|
|
- name: Update SDK Typescript definitions
|
|
|
|
run: node ./scripts/release/update-sdk-ts-defs.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
|
2023-04-28 00:31:21 +02:00
|
|
|
uses: JS-DevTools/npm-publish@v2
|
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:
|
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
|
2022-11-24 15:39:11 +02:00
|
|
|
uses: kceb/git-message-action@v2
|
2023-10-28 21:31:47 +02:00
|
|
|
- id: get-version
|
2023-11-05 21:35:53 +02:00
|
|
|
uses: ./.github/actions/get-version
|
2023-07-30 23:08:20 +02:00
|
|
|
- name: Replace CDN theme image links from README
|
2023-11-27 12:50:10 +02:00
|
|
|
run: node ./scripts/release/reformat-readme.js "${{ steps.get-version.outputs.version }}"
|
2022-04-18 14:56:17 +02:00
|
|
|
- name: Configure GIT credentials
|
|
|
|
run: |
|
|
|
|
git config user.name "${GITHUB_ACTOR}"
|
|
|
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
|
|
# 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
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.get-version.outputs.version }}
|
2021-08-29 18:59:33 +02:00
|
|
|
release_name: ${{ steps.commit.outputs.title }}
|
|
|
|
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:
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Trigger simple-icons-font release
|
|
|
|
run: |
|
|
|
|
curl -X POST \
|
2021-01-18 14:18:02 +02:00
|
|
|
-H "Authorization: Bearer ${{ secrets.REMOTE_DISPATCH_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:
|
|
|
|
- name: Trigger simple-icons-website update
|
|
|
|
run: |
|
|
|
|
curl -X POST \
|
|
|
|
-H "Authorization: Bearer ${{ secrets.REMOTE_DISPATCH_TOKEN }}" \
|
|
|
|
-d '{"ref":"master"}' \
|
|
|
|
https://api.github.com/repos/simple-icons/simple-icons-website/actions/workflows/auto-release.yml/dispatches
|