Skip to content

Commit

Permalink
build: upgrade setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Jun 8, 2024
1 parent 28c3794 commit b255464
Show file tree
Hide file tree
Showing 13 changed files with 6,553 additions and 5,590 deletions.
14 changes: 6 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: 'github-actions'
directory: '/'
target-branch: develop
schedule:
interval: 'daily'
# Maintain dependencies for npm
# - package-ecosystem: 'npm'
# directory: '/'
# target-branch: develop
# schedule:
# interval: 'daily'
interval: 'monthly'
- package-ecosystem: 'npm'
directory: '/'
target-branch: develop
schedule:
interval: 'monthly'
22 changes: 22 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'enhancement'
- 'feature'
- title: '🐛 Bugs Fixes'
labels:
- 'bug'
- title: 'Documentation'
labels:
- 'documentation'
- title: '🧰 Development'
labels:
- 'chore'
change-template: '- #$NUMBER $TITLE'
change-title-escapes: '\<*_&`#@'
template: |
$CHANGES
Thanks to $CONTRIBUTORS
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: ci

on: [push]
on:
- push
- pull_request

jobs:
build:
Expand All @@ -9,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm i -g yarn
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
Expand All @@ -18,9 +20,9 @@ jobs:
path: |
./.yarn/cache
./.yarn/unplugged
key: ${{ runner.os }}-yarn2-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-yarn2-v5-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn2-
${{ runner.os }}-yarn2-v5
- run: yarn install
- run: yarn build
- run: yarn lint
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Create Release
on:
workflow_dispatch:
inputs:
versionName:
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
required: true
default: patch
preid:
description: 'Pre Release Identifier (i.e., alpha, beta)'
required: true
default: alpha
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: main
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
- name: Reset main branch
run: |
git fetch origin dev:dev
git reset --hard origin/dev
- name: Change version number
id: version
run: |
echo "next_tag=$(npm version --no-git-tag-version ${{ github.event.inputs.versionName }} --preid ${{ github.event.inputs.preid }})" >> $GITHUB_OUTPUT
- name: Create pull request into main
uses: peter-evans/create-pull-request@v6
with:
branch: release/${{ steps.version.outputs.next_tag }}
commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}'
base: main
title: Release ${{ steps.version.outputs.next_tag }}
labels: chore
assignees: sgratzl
body: |
Releasing ${{ steps.version.outputs.next_tag }}.
97 changes: 97 additions & 0 deletions .github/workflows/release_helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release Helper
on:
push:
branches:
- main

jobs:
correct_repository:
runs-on: ubuntu-latest
steps:
- name: fail on fork
if: github.repository_owner != 'sgratzl'
run: exit 1

create_release:
needs: correct_repository
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Extract version
id: extract_version
run: |
node -pe "'version=' + require('./package.json').version" >> $GITHUB_OUTPUT
node -pe "'npm_tag=' + (require('./package.json').version.includes('-') ? 'next' : 'latest')" >> $GITHUB_OUTPUT
- name: Print version
run: |
echo "releasing ${{ steps.extract_version.outputs.version }} with tag ${{ steps.extract_version.outputs.npm_tag }}"
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: v${{ steps.extract_version.outputs.version }}
tag: v${{ steps.extract_version.outputs.version }}
version: ${{ steps.extract_version.outputs.version }}
prerelease: ${{ needs.create_release.outputs.tag_name == 'next' }}
publish: true
outputs:
version: ${{ steps.extract_version.outputs.version }}
npm_tag: ${{ steps.extract_version.outputs.npm_tag }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag_name: ${{ steps.create_release.outputs.tag_name }}

build_assets:
needs: create_release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i -g yarn
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: |
./.yarn/cache
./.yarn/unplugged
key: ${{ runner.os }}-yarn2-v5-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn2-v5
- run: yarn install
- run: yarn build
- run: yarn pack
- name: Upload Release Asset
uses: AButler/[email protected]
with:
files: 'package.tgz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ needs.create_release.outputs.tag_name }}
- name: Pack Publish
run: |
yarn config set npmAuthToken "${{ secrets.NPM_TOKEN }}"
yarn pack
yarn npm publish --tag "${{ needs.create_release.outputs.npm_tag }}"
sync_dev:
needs: correct_repository
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: develop
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
- name: Reset dev branch
run: |
git fetch origin main:main
git merge main
git push
17 changes: 0 additions & 17 deletions .release-it.json

This file was deleted.

768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarnPath: .yarn/releases/yarn-3.1.1.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
File renamed without changes.
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,31 @@
"fmin": "^0.0.2"
},
"devDependencies": {
"@babel/core": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.1.1",
"@yarnpkg/sdks": "^2.5.1-rc.6",
"babel-jest": "^27.4.5",
"canvas": "^2.8.0",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.4.5",
"jest-image-snapshot": "^4.5.1",
"prettier": "^2.5.1",
"release-it": "^14.11.8",
"rimraf": "^3.0.2",
"rollup": "^2.61.1",
"@babel/core": "^7.24.7",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@yarnpkg/sdks": "^3.1.2",
"babel-jest": "^29.7.0",
"canvas": "^2.11.2",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"jest-image-snapshot": "^6.4.0",
"prettier": "^3.3.1",
"release-it": "^17.3.0",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"rollup-plugin-pnp-resolve": "^2.0.0",
"uglify-es": "^3.3.9"
},
"scripts": {
"clean": "rimraf build *.tgz",
"watch": "rollup -c -w",
"lint": "eslint src --ext js",
"lint": "eslint src",
"test": "jest --passWithNoTests",
"test:watch": "jest --watch",
"posttest": "npm run lint",
Expand All @@ -97,5 +97,5 @@
"release": "release-it --disable-metrics --npm.skipChecks",
"release:pre": "release-it --disable-metrics --npm.skipChecks --preRelease=alpha --npm.tag=next"
},
"packageManager": "yarn@3.1.1"
"packageManager": "yarn@4.2.2"
}
5 changes: 4 additions & 1 deletion rollup.config.js → rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import pnp from 'rollup-plugin-pnp-resolve';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import pkg from './package.json';

import fs from 'fs';

const pkg = JSON.parse(fs.readFileSync('./package.json'));

export default [
{
Expand Down
Loading

0 comments on commit b255464

Please sign in to comment.