Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Workflow updates #422

Merged
merged 3 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/lint_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ jobs:
with:
node-version-file: '.nvmrc'

- name: Cache yarn dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install

- name: Run ESLint
Expand Down
30 changes: 5 additions & 25 deletions .github/workflows/main_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,15 @@ jobs:
with:
node-version-file: '.nvmrc'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Cache yarn dependencies
id: cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: ./node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install

- name: Build Module
Expand All @@ -74,23 +70,8 @@ jobs:
env:
REPO: ${{ github.repository }}

# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'module.json'
env:
version: ${{steps.bump_version.outputs.new_tag}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json
download: https://github.com/${{github.repository}}/releases/download/${{steps.bump_version.outputs.new_tag}}/module.zip

# Create a zip file with all files required by the module to add to the release
- run: zip -r ./module.zip module.json LICENSE dist/ languages/ styles/ templates/ packs/

# Create a release for this specific version
- name: Update Release with Files
- name: Create Release
id: create_version_release
uses: ncipollo/release-action@v1
with:
Expand All @@ -99,6 +80,5 @@ jobs:
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./module.zip'
tag: ${{ steps.bump_version.outputs.new_tag }}
body: ${{ steps.changelog.outputs.changelog }}
18 changes: 6 additions & 12 deletions .github/workflows/publish_unit_tests_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: eslint_report
path: eslint_report.json
path: .

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
Expand All @@ -43,14 +43,8 @@ jobs:
min-line-coverage: 50
min-method-coverage: 50

# - name: Annotate Code Linting Results
# uses: ataylorme/eslint-annotate-action@v2
# with:
# repo-token: "${{ secrets.GITHUB_TOKEN }}"
# report-json: "eslint_report.json"

# - name: Upload ESLint report
# uses: actions/upload-artifact@v3
# with:
# name: eslint_report.json
# path: eslint_report.json
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "eslint_report.json"
81 changes: 81 additions & 0 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "[Workflow] Release"

on:
release:
types: [published]

jobs:
create_changelog_commit:
name: Create and commit Changelog
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.tag_name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.release.target_commitish }}
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md

create_tag_publish:
name: Build assets and Publish to release
runs-on: ubuntu-latest
permissions:
contents: write
needs: ['create_changelog_commit']
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache yarn dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install

- name: Build Module
run: yarn run build

# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'module.json'
env:
version: ${{github.event.release.tag_name}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip

# Create a zip file with all files required by the module to add to the release
- run: zip -r ./module.zip module.json CHANGELOG.md LICENSE dist/ languages/ templates/ packs/

# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
name: ${{ github.event.release.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./module.zip'
8 changes: 8 additions & 0 deletions .github/workflows/test_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ jobs:
with:
node-version-file: '.nvmrc'

- name: Cache yarn dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install

- name: Run Jest
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

## 2.6.4

- [PATCH] Update verified version and remove debug code
52 changes: 7 additions & 45 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"branchPrefix": "renovate-",
"commitMessageAction": "Renovate Update",
"labels": [
"Dependencies",
"Renovate"
],
"lockFileMaintenance": {
"enabled": true
},
"packageRules": [
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch",
"automerge": true,
"labels": ["dependencies"]
},
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["major"],
"labels": ["dependencies", "breaking"]
},
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["digest"],
"groupName": "all digests",
"groupSlug": "all-digest-patch",
"automerge": true,
"schedule": ["before 3am on Monday"],
"labels": ["digest"]
}
],
"vulnerabilityAlerts": {
"groupName": "Vulnerability Patches",
"dependencyDashboardApproval": false,
"stabilityDays": 0,
"rangeStrategy": "update-lockfile",
"commitMessagePrefix": "[SECURITY]",
"branchTopic": "{{{datasource}}}-{{{depName}}}-vulnerability",
"prCreation": "immediate",
"prPriority": 2
}
"config:base",
"schedule:daily",
":pinAllExceptPeerDependencies",
":automergeAll",
"npm:unpublishSafe",
"group:all"
]
}
2 changes: 2 additions & 0 deletions scripts/CampaignRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CampaignRenderer {
// Get unique EventIds
const eventIds = []
.concat(
// eslint-disable-next-line no-unsafe-optional-chaining
...statList?.map((m) =>
m.data.map((im) => {
return im.EventName;
Expand Down Expand Up @@ -197,6 +198,7 @@ class CampaignRenderer {

const flattenedResults = []
.concat(
// eslint-disable-next-line no-unsafe-optional-chaining
...statList?.map((m) =>
m.data?.map((im) => {
return im?.actorName;
Expand Down
1 change: 0 additions & 1 deletion scripts/SetupHooksPF2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
import StatManager from "./StatManager";
import { CombatDetailType, ChatType } from "./enums";
import Stat from "./stats/Stat";
import Logger from "./Helpers/Logger";
import PF2e from "./parsers/PF2e";

export default class SetupHooksPF2e {
Expand Down
2 changes: 1 addition & 1 deletion scripts/types/CampaignRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface CampaignRender {
fumbleHistory: Array<CampaignRollRowData>;
healsHistory: Array<CampaignRollRowData>;
killsHistory: Array<CampaignRollRowData>;
rollstreak: Array<CampaignRollRowData>;
rollstreak: Array<CampaignRollRowData> | undefined;
customEventHistory: Array<CampaignCustomData> | undefined;
}

Expand Down