Skip to content

Commit

Permalink
Autobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
constant-null committed Feb 26, 2024
1 parent 05e65e7 commit f9c7d24
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 12 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Release Creation

on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4
with:
lfs: true

# Set up our some variables for future use
# Adapted from https://github.community/t/how-to-get-just-the-tag-name/16241/7
# Tag name: ${{ steps.get_vars.outputs.TAG_NAME }}
# Zip name: ${{ steps.get_vars.outputs.ZIP_NAME }}
# Expected Release Download URL: ${{ steps.get_vars.outputs.RELEASE_DOWNLOAD_URL }}
# Expected Release system.json URL: ${{ steps.get_vars.outputs.RELEASE_INSTALL_URL }}
# Stringified system.json contents: ${{ steps.get_vars.outputs.SYSTEM_JSON }}
- name: Set up variables
id: get_vars
run: |
TAG=${GITHUB_REF/refs\/tags\//}
echo "TAG_NAME=$TAG" >> $GITHUB_OUTPUT
echo "ZIP_NAME=efs-$TAG.zip" >> $GITHUB_OUTPUT
echo "RELEASE_DOWNLOAD_URL=https://github.com/${{github.repository}}/releases/download/$TAG/efs-$TAG.zip" >> $GITHUB_OUTPUT
echo "RELEASE_INSTALL_URL=https://github.com/${{github.repository}}/releases/download/$TAG/system.json" >> $GITHUB_OUTPUT
- name: Adjust manifest
uses: joshlrogers/variable-substitution@v1.1.5
with:
files: "system.json"
env:
download: ${{steps.get_vars.outputs.RELEASE_DOWNLOAD_URL}}

- name: Read adjusted manifest
id: read_manifest
run: |
JSON=$(cat ./system.json)
echo ::set-output name=MANIFEST_JSON::${JSON//'%'/'%25'}
# Run some tests to make sure our `system.json` is correct
# Exit before setting up node if not
- name: Verify correct naming
env:
TAG_NAME: ${{ steps.get_vars.outputs.TAG_NAME }}
RELEASE_DOWNLOAD: ${{steps.get_vars.outputs.RELEASE_DOWNLOAD_URL}}
PACKAGE_VERSION: ${{fromJSON(steps.read_manifest.outputs.MANIFEST_JSON).version}}
PACKAGE_DOWNLOAD: ${{fromJSON(steps.read_manifest.outputs.MANIFEST_JSON).download}}
run: |
# Validate that the tag being released matches the package version.
if [[ ! $TAG_NAME == $PACKAGE_VERSION ]]; then
echo "The system.json version does not match tag name."
echo "system.json: $PACKAGE_VERSION"
echo "tag name: $TAG_NAME"
echo "Please fix this and push the tag again."
exit 1
fi
# Validate that the package download url matches the release asset that will be created.
if [[ ! $RELEASE_DOWNLOAD == $PACKAGE_DOWNLOAD ]]; then
echo "The system.json download url does not match the created release asset url."
echo "system.json: $PACKAGE_DOWNLOAD"
echo "release asset url: $RELEASE_DOWNLOAD"
echo "Please fix this and push the tag again."
exit 1
fi
# `npm ci` is recommended:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
- name: Install Dependencies
run: npm ci

- name: Build All
run: npm run build:pack
# Create a zip file with all files required by the module to add to the release
- run: zip ${{steps.get_vars.outputs.ZIP_NAME}} -r assets lang module packs sockets styles templates system.json template.json


# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{steps.get_vars.outputs.TAG_NAME}}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json, ./${{steps.get_vars.outputs.ZIP_NAME}}'
tag: ${{steps.get_vars.outputs.TAG_NAME}}
body: '**Installation:** To manually install this release, please use the following manifest URL: ${{steps.get_vars.outputs.RELEASE_INSTALL_URL}}'
4 changes: 2 additions & 2 deletions module/efs-character.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default class EFSCharacter extends Actor {
actorLink: subtype === "character",
disposition: subtype === "character" ? 1 : -1,
vision: subtype === "character",
displayBars: 40,
bar1: {attribute: "dp"},
// displayBars: 40,
// bar1: {attribute: "dp"},
}
}

Expand Down
1 change: 0 additions & 1 deletion module/sheets/efs-character-extra-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default class EFSCharacterExtraSheet extends ActorSheet {
html.find(".add-item").click(this._onAddItem.bind(this))
}


_onEditItem(event) {
event.preventDefault();

Expand Down
21 changes: 12 additions & 9 deletions system.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "efs",
"title": "Bylina Failure (Былинный Отказ)",
"description": "The official system for Bylina Failure game. Официальная система для игры Былинный отказ",
"author": "Mark Belotskiy",
"version": "1.6.1",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "10.291",
"version": "1.6.2",
"compatibility": {
"minimum": "9",
"verified": "11"
},
"esmodules": [
"efs.js"
],
Expand All @@ -16,16 +16,19 @@
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
"path": "lang/en.json",
"flags": {}
},
{
"lang": "ru",
"name": "Русский",
"path": "lang/ru.json"
"path": "lang/ru.json",
"flags": {}
}
],
"url": "https://github.com/constant-null/efs",
"manifest": "https://github.com/constant-null/efs/releases/latest/download/system.json",
"download": "https://github.com/constant-null/efs/releases/download/1.6.1/efs-1.6.1.zip",
"license": "LICENSE"
"download": "https://github.com/constant-null/efs/archive/refs/heads/master.zip",
"license": "LICENSE",
"id": "efs"
}

0 comments on commit f9c7d24

Please sign in to comment.