Skip to content

Commit

Permalink
Upgrades & fixes (#77)
Browse files Browse the repository at this point in the history
* Fix `file.patch`

* Allow trigger release by workflow dispatch

* Add missing `client` parameter

* Allow skipping release note with `skip release note` label

* Update distribution file

* Bump Node.js 20 & fix deprecated APIs

* Fix builds and tests

* Update test command

* Fix imports

* Fix variable usages

* Decode matched SVG title

* Update distribution files

* Replace Generator with async/await
  • Loading branch information
LitoMore authored Dec 27, 2023
1 parent 5edfadc commit a801a2a
Show file tree
Hide file tree
Showing 12 changed files with 3,395 additions and 1,441 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 12.x
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 20
- name: Install dependencies
run: npm ci
- name: Build lib/
Expand All @@ -21,11 +21,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 12.x
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 20
- name: Install dependencies
run: npm ci
- name: Check code style
Expand All @@ -35,11 +35,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 12.x
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 20
- name: Install dependencies
run: npm ci
- name: Run tests
Expand Down
6 changes: 1 addition & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

git stash -q --keep-index

# Format the code base
npm run format
git add .

# Compile into lib/
npm run build
git add lib/index.cjs

git stash pop -q
git add lib/index.mjs
26 changes: 25 additions & 1 deletion __mocks__/@actions/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,109 +38,133 @@ const PRs = [
// https://developer.github.com/v3/pulls/#list-pull-requests
{
// 0: PR that was not merged
title: '500',
number: 500,
merged_at: null,
base: { ref: 'develop' },
},
{
// 1: PR that adds a file
title: '501',
number: 501,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 2: PR that modifies an SVG
title: '502',
number: 502,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 3: PR that was merged before the previous release
title: '498',
number: 498,
merged_at: '2011-01-01T19:01:12Z',
base: { ref: 'develop' },
},
{
// 4: PR that modifies one icon's color
title: '503',
number: 503,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 5: PR that modifies one icon's source
title: '504',
number: 504,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 6: PR that modifies one icon's color and source
title: '505',
number: 505,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 7: PR that modifies an SVG and modifies that icon's color
title: '506',
number: 506,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 8: PR that modifies an SVG and modifies that icon's source
title: '507',
number: 507,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 9: PR that modifies an SVG and modifies that icon's color and source
title: '508',
number: 508,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 10: PR that adds an SVG and modifies another icon's color and source
title: '509',
number: 509,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 11: PR that adds an SVG and modifies another SVG
title: '510',
number: 510,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 12: PR that changes the data file but no metadata
title: '511',
number: 511,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 13: PR that adds a brand with a lowercased name
title: '512',
number: 512,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 14: PR that adds ACM (which should be listed before the lowercased brand)
title: '513',
number: 513,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 15: PR that adds a brand with an accented name
title: '514',
number: 514,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},
{
// 16: PR that removes an icon
title: '515',
number: 515,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'develop' },
},

{
// Skipped release
title: '[skip] Skip this one',
number: 516,
merged_at: '2011-01-26T19:01:12Z',
base: { ref: 'master' },
},
{
// Previous release
title: 'Release',
number: 499,
merged_at: '2011-01-02T19:01:12Z',
base: { ref: 'master' },
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ inputs:
required: true

runs:
using: 'node12'
main: 'lib/index.cjs'
using: 'node20'
main: 'lib/index.mjs'
1 change: 0 additions & 1 deletion lib/index.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions lib/index.mjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Loading

0 comments on commit a801a2a

Please sign in to comment.