Skip to content

Commit

Permalink
auto build release
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcomac committed Jul 2, 2024
1 parent 381e1f4 commit 1415e98
Show file tree
Hide file tree
Showing 23 changed files with 3,159 additions and 8,888 deletions.
73 changes: 14 additions & 59 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,30 @@ jobs:
id: get_version
uses: battila7/get-version-action@v2

# Set up Node.js
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install

# Build Release
- name: Generate release
run: npm run release

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

# Set up Node.js
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install

# Generate minified CSS
- name: Generate minified CSS
run: npm run build:css

# Run Rollup Build
- name: Run Rollup Build
run: npm run build

# Create a zip file with all files required by the system to add to the release
- run: zip -r ./system.zip system.json template.json readme.md LICENSE.txt assets/ build/ fonts/ lang/ templates/ packs/ readme/ styles/
- run: cd release && zip -r ./system.zip system.json template.json readme.md LICENSE.txt assets/ build/ fonts/ lang/ templates/ packs/ readme/ styles/

# Update Release with Files
- name: Update Release with Files
Expand All @@ -54,49 +50,8 @@ jobs:
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.REPO_SEC }}
artifacts: './system.json, ./system.zip'
artifacts: './release/system.json, ./release/system.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

# Publish version to foundry
- name: Get System ID
id: systemID
uses: notiz-dev/github-action-json-property@release
with:
path: "./system.json"
prop_path: "id"

- name: Get minimum
id: minimum
uses: notiz-dev/github-action-json-property@release
with:
path: "./system.json"
prop_path: "compatibility.minimum"

- name: Get verified
id: verified
uses: notiz-dev/github-action-json-property@release
with:
path: "./system.json"
prop_path: "compatibility.verified"

# Submit to foundry
- name: Submit package to FoundryVTT Package Release API
run: |
curl -X POST "https://api.foundryvtt.com/_api/packages/release_version/" \
-H "Content-Type: application/json" \
-H "Authorization: ${{ secrets.FOUNDRY_KEY }}" \
-d '{
"id": "${{ steps.systemID.outputs.prop }}",
"dry-run": false,
"release": {
"version": "${{ steps.get_version.outputs.version-without-v }}",
"manifest": "https://github.com/${{ github.repository }}/releases/latest/download/system.json",
"notes": "https://github.com/${{ github.repository }}/releases/tag/${{ steps.get_version.outputs.version-without-v }}",
"compatibility": {
"minimum": "${{ steps.minimum.outputs.prop }}",
"verified": "${{ steps.verified.outputs.prop }}",
"maximum": ""
}
}
}'

138 changes: 5 additions & 133 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,133 +1,5 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Zip files
*.zip
*.lock
node_modules
*.zip
release/*
build/*
Binary file added assets/official/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/official/logo_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1415e98

Please sign in to comment.