Skip to content

Commit 35503ac

Browse files
committed
v0.5.3
1 parent baa0a03 commit 35503ac

43 files changed

Lines changed: 425 additions & 2757 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ module.exports = {
33
"env": {
44
"browser": true,
55
"es6": true,
6-
"jquery": true
6+
"jquery": true,
77
},
88
"parserOptions": {
99
"ecmaVersion": 2020,
10-
"sourceType": "module"
10+
"sourceType": "module",
1111
},
1212
"rules": {
1313
"accessor-pairs": "off",
@@ -19,7 +19,7 @@ module.exports = {
1919
"objects": "always-multiline",
2020
"imports": "always-multiline",
2121
"exports": "always-multiline",
22-
"functions": "always-multiline"
22+
"functions": "always-multiline",
2323
}],
2424
"comma-spacing": ["error", {"before": false, "after": true}],
2525
"comma-style": ["error", "last"],
@@ -34,8 +34,8 @@ module.exports = {
3434
"error",
3535
"tab",
3636
{
37-
"SwitchCase": 1
38-
}
37+
"SwitchCase": 1,
38+
},
3939
],
4040
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
4141
"keyword-spacing": ["error", {"before": true, "after": true}],
@@ -78,9 +78,9 @@ module.exports = {
7878
"groups": [
7979
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
8080
["&&", "||"],
81-
["in", "instanceof"]
81+
["in", "instanceof"],
8282
],
83-
"allowSamePrecedence": true
83+
"allowSamePrecedence": true,
8484
}],
8585
"no-mixed-spaces-and-tabs": "error",
8686
"no-multi-spaces": "error",
@@ -121,7 +121,7 @@ module.exports = {
121121
"no-unused-expressions": ["error", {
122122
"allowShortCircuit": true,
123123
"allowTernary": true,
124-
"allowTaggedTemplates": true
124+
"allowTaggedTemplates": true,
125125
}],
126126
"no-unused-vars": "off",
127127
"no-use-before-define": ["error", {"functions": false, "classes": false, "variables": false}],
@@ -144,8 +144,8 @@ module.exports = {
144144
"*": "before",
145145
"/": "before",
146146
"||": "before",
147-
"&&": "before"
148-
}
147+
"&&": "before",
148+
},
149149
}],
150150
"padded-blocks": ["error", {"blocks": "never", "switches": "never", "classes": "never"}],
151151
"prefer-promise-reject-errors": "error",
@@ -161,8 +161,8 @@ module.exports = {
161161
"block": {
162162
"balanced": true,
163163
"markers": ["*package", "!", ",", ":", "::", "flow-include"],
164-
"exceptions": ["*"]
165-
}
164+
"exceptions": ["*"],
165+
},
166166
}],
167167
"symbol-description": "error",
168168
"template-curly-spacing": ["error", "never"],
@@ -178,6 +178,6 @@ module.exports = {
178178
"no-console": "error",
179179
"prefer-template": "error",
180180
"quotes": ["error", "double", {"allowTemplateLiterals": true}],
181-
"no-var": "error"
182-
}
181+
"no-var": "error",
182+
},
183183
};

.github/workflows/main.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v**'
7+
8+
env:
9+
# See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
10+
IMAGE_NAME: pf2etools
11+
12+
jobs:
13+
build-and-deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@master
17+
18+
# See: https://stackoverflow.com/a/58178121
19+
- name: Set Env
20+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
21+
22+
- name: Archive Release
23+
run: |
24+
zip -r pf2ools-${{ env.RELEASE_VERSION }}.zip . -x '*.git*' '*node_modules*' '*.github*' '*img*' '*.editorconfig*' '*CNAME*'
25+
- name: Set Deployed Flag
26+
run: |
27+
bash ./.github/set-deployed-flag.sh ${{ env.RELEASE_VERSION }}
28+
# Remove entries from the `.gitignore` so the gh-pages action can correctly add+commit them to the pages branch
29+
- name: Build Service Worker
30+
run: |
31+
node --version
32+
npm --version
33+
npm i
34+
npm run build:sw:prod
35+
sed -i 's/sw.js//g' .gitignore
36+
sed -i 's/sw-injector.js//g' .gitignore
37+
- name: Build SEO Pages
38+
env:
39+
VET_BASE_SITE_URL: https://pf2etools.com/
40+
VET_SEO_IS_SKIP_UA_ETC: true
41+
run: |
42+
npm run build:seo -- ${{ env.RELEASE_VERSION }}
43+
# See: https://github.com/JamesIves/github-pages-deploy-action
44+
- name: Deploy
45+
uses: JamesIves/github-pages-deploy-action@releases/v4
46+
with:
47+
branch: prod
48+
folder: .
49+
50+
- name: Archive Images
51+
run: |
52+
zip -r -s 500m img-${{ env.RELEASE_VERSION }}.zip img/
53+
- name: Upload Release
54+
# Add the files one-by-one in an effort to avoid timeouts
55+
run: |
56+
hub release create -a pf2ools-${{ env.RELEASE_VERSION }}.zip -m ${{ env.RELEASE_VERSION }} ${{ env.RELEASE_VERSION }}
57+
for f in $(find . -name 'img-${{ env.RELEASE_VERSION }}.*' -print); do hub release edit ${{ env.RELEASE_VERSION }} -m '' -a $f; done
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
# region See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
62+
- name: Build Image
63+
run: |
64+
docker build -t $IMAGE_NAME .
65+
- name: Log In to Registry
66+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
67+
68+
- name: Push Image
69+
run: |
70+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
71+
# Change all uppercase to lowercase
72+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
73+
# Strip git ref prefix from version
74+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
75+
# Strip "v" prefix from tag name
76+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
77+
echo IMAGE_ID=$IMAGE_ID
78+
echo VERSION=$VERSION
79+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
80+
# Always tag latest when pushing a tag, as we don't expect to ever merge old tags
81+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && docker tag $IMAGE_NAME $IMAGE_ID:latest
82+
docker push $IMAGE_ID:$VERSION
83+
docker push $IMAGE_ID:latest
84+
# endregion

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Pf2e.Tools
2-
[![Automated Build](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/build.yml)
2+
[![Automated Build](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/main.yml)
33

44
Visit the main site (not yet) or go to the unofficial GitHub [mirror](https://pf2etools.com).
55

css/style.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)