2021-04-08 03:15:11 +03:00
|
|
|
name: Publish Releases
|
2020-11-28 13:34:36 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-01-15 23:47:00 +03:00
|
|
|
- master
|
2020-11-28 13:34:36 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-06-29 13:07:50 +03:00
|
|
|
sanity-check:
|
|
|
|
name: Pre-publish checks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/checkout@v3
|
2022-02-04 17:24:11 +03:00
|
|
|
- name: Use Node.js 16.x
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/setup-node@v3
|
2021-06-29 13:07:50 +03:00
|
|
|
with:
|
2022-02-04 17:24:11 +03:00
|
|
|
node-version: 16.x
|
2021-06-29 13:07:50 +03:00
|
|
|
- name: Cache dependencies
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 13:07:50 +03:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 20:21:03 +03:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 13:07:50 +03:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install dependencies
|
2021-08-23 20:21:03 +03:00
|
|
|
run: npm i
|
2021-06-29 13:07:50 +03:00
|
|
|
- name: Run linters
|
|
|
|
run: npm run lint
|
2021-10-31 13:38:10 +03:00
|
|
|
- name: Build NodeJS package
|
|
|
|
run: npm run build
|
2021-06-29 13:07:50 +03:00
|
|
|
- name: Run tests
|
|
|
|
run: npm run test
|
2020-11-28 13:34:36 +03:00
|
|
|
npm:
|
|
|
|
name: NPM Package
|
2021-06-29 13:07:50 +03:00
|
|
|
needs: sanity-check
|
2020-11-28 13:34:36 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Checkout
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/checkout@v3
|
2022-02-04 17:24:11 +03:00
|
|
|
- name: Use Node.js 16.x
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/setup-node@v3
|
2021-01-15 23:47:00 +03:00
|
|
|
with:
|
2022-02-04 17:24:11 +03:00
|
|
|
node-version: 16.x
|
2021-06-29 13:07:50 +03:00
|
|
|
- name: Cache dependencies
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 13:07:50 +03:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 20:21:03 +03:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 13:07:50 +03:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
2022-01-10 00:04:36 +03:00
|
|
|
- name: Remove dark theme images from README
|
2022-11-27 14:46:23 +03:00
|
|
|
uses: mondeja/strip-gh-theme-links@v4
|
2022-01-10 00:04:36 +03:00
|
|
|
with:
|
|
|
|
files: README.md
|
2022-11-27 14:46:23 +03:00
|
|
|
keep: light
|
2022-01-10 00:04:36 +03:00
|
|
|
strict: true
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Install dependencies
|
2021-08-23 20:21:03 +03:00
|
|
|
run: npm i
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Deploy to NPM
|
|
|
|
uses: JS-DevTools/npm-publish@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
2020-11-28 13:34:36 +03:00
|
|
|
github:
|
|
|
|
name: GitHub release
|
2021-06-29 13:07:50 +03:00
|
|
|
needs: sanity-check
|
2020-11-28 13:34:36 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Checkout
|
2022-05-09 14:17:22 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Get commit message (for release title and body)
|
|
|
|
id: commit
|
2022-11-24 16:39:11 +03:00
|
|
|
uses: kceb/git-message-action@v2
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Get release version
|
|
|
|
id: get-version
|
|
|
|
run: |
|
|
|
|
export PACKAGE_VERSION=$(cat package.json | grep 'version' | sed 's/[ \",:]//g' | sed 's/version//')
|
|
|
|
echo "::set-output name=version::$PACKAGE_VERSION"
|
2022-01-10 00:04:36 +03:00
|
|
|
- name: Remove dark theme images from README
|
2022-11-27 14:46:23 +03:00
|
|
|
uses: mondeja/strip-gh-theme-links@v4
|
2022-01-10 00:04:36 +03:00
|
|
|
with:
|
|
|
|
files: README.md
|
2022-11-27 14:46:23 +03:00
|
|
|
keep: light
|
2022-01-10 00:04:36 +03:00
|
|
|
strict: true
|
2022-04-18 15:56:17 +03: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
|
2022-01-10 00:04:36 +03:00
|
|
|
- name: Commit dark theme images strip
|
|
|
|
run: |
|
|
|
|
git add README.md
|
|
|
|
git commit -m 'Strip README dark theme image links'
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Create and push git tag
|
2022-04-18 15:56:17 +03: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 23:47:00 +03: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 19:59:33 +03:00
|
|
|
release_name: ${{ steps.commit.outputs.title }}
|
|
|
|
body: ${{ steps.commit.outputs.body }}
|
2021-01-01 21:29:47 +03:00
|
|
|
font:
|
|
|
|
name: Trigger simple-icons-font release
|
|
|
|
needs: npm
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-15 23:47:00 +03:00
|
|
|
- name: Trigger simple-icons-font release
|
|
|
|
run: |
|
|
|
|
curl -X POST \
|
2021-01-18 15:18:02 +03:00
|
|
|
-H "Authorization: Bearer ${{ secrets.REMOTE_DISPATCH_TOKEN }}" \
|
2021-01-15 23:47:00 +03:00
|
|
|
-d '{"ref":"develop"}' \
|
|
|
|
https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches
|
2021-01-18 15:18:02 +03: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
|