Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci/add package release api and build from cache #496

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
32 changes: 26 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Checkout repository to add to workspace
uses: actions/checkout@v2

- name: Setup Node.js version 16
- name: Setup Node.js version 18
uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "18"

# # Caching to improve build speed
- name: Enable caching for Node.js modules
Expand All @@ -27,12 +27,12 @@ jobs:
${{ runner.OS }}-node-
${{ runner.OS }}-

# Get dev dependencies for the package, including Gulp and Rollup
# Get dev dependencies for the package, including Rollup
- name: Install dev dependencies
run: npm ci #--cache .npm --prefer-offline --ignore-scripts
run: npm ci --cache .npm --prefer-offline --ignore-scripts

# Create a build using Gulp build script
- name: Run Gulp build script
# Create a build using Rollup build script
- name: Run Rollup build script
run: npm run build

# Insert "manifest", "download", and "version" for this release into the system.json manifest file
Expand Down Expand Up @@ -69,3 +69,23 @@ jobs:
artifacts: "./system.json, ./system.zip"
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
# Post to Package Release API
- name: Post to Package Release API
run: |
curl --request POST \
--url https://api.foundryvtt.com/_api/packages/release_version \
--header 'Authorization: ${{ secrets.FVTT_PACKAGE_RELEASE_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '{
"id": "ose",
"release": {
"version": "${{ github.event.release.tag_name }}",
"manifest": "https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.json",
"notes": "https://github.com/https://github.com/${{github.repository}}/releases/tag/${{github.event.release.tag_name}}",
"compatibility": {
"minimum": "11",
"verified": "11",
"maximum": "11"
Comment on lines +86 to +88
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be cool if these could be dynamically set somehow so we can leave our CI file alone when a new Foundry version comes out.

Copy link
Member Author

@anthonyronda anthonyronda Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You make a good point. This will be fixed before I merge this. We're already manipulating fields in the manifest before submitting to the API, so we might as well grab these

}
}
}'
Loading