|
32 | 32 | # |
33 | 33 | name: Create System Files For GitHub Release |
34 | 34 |
|
35 | | - |
36 | 35 | env: |
37 | | - # The URL used for the system's "Project URL" link on FoundryVTT's website. |
38 | | - project_url: "https://github.com/${{github.repository}}" |
39 | | - |
40 | | - # A URL that will always point to the latest manifest. |
41 | | - # FoundryVTT uses this URL to check whether the current module version that |
42 | | - # is installed is the latest version. This URL should NOT change, |
43 | | - # otherwise FoundryVTT won't be able to perform this check. |
44 | | - latest_manifest_url: "https://github.com/${{github.repository}}/releases/latest/download/system.json" |
| 36 | + # The URL used for the system's "Project URL" link on FoundryVTT's website. |
| 37 | + project_url: 'https://github.com/${{github.repository}}' |
45 | 38 |
|
46 | | - # The URL to the module archive associated with the module release being |
47 | | - # processed by this workflow. |
48 | | - release_system_url: "https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/fabulaultima.zip" |
| 39 | + # A URL that will always point to the latest manifest. |
| 40 | + # FoundryVTT uses this URL to check whether the current module version that |
| 41 | + # is installed is the latest version. This URL should NOT change, |
| 42 | + # otherwise FoundryVTT won't be able to perform this check. |
| 43 | + latest_manifest_url: 'https://github.com/${{github.repository}}/releases/latest/download/system.json' |
49 | 44 |
|
| 45 | + # The URL to the module archive associated with the module release being |
| 46 | + # processed by this workflow. |
| 47 | + release_system_url: 'https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/fabulaultima.zip' |
50 | 48 |
|
51 | 49 | on: |
52 | | - # Only run this workflow when a release is published. |
53 | | - # To modify this workflow when other events occur, see: |
54 | | - # - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow |
55 | | - # - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows |
56 | | - # - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on |
57 | | - # |
58 | | - # Note that some steps may depend on context variables that are only |
59 | | - # available for release events, so if you add other events, you may need to |
60 | | - # alter other parts of this workflow. |
61 | | - release: |
62 | | - types: [published] |
63 | | - |
| 50 | + # Only run this workflow when a release is published. |
| 51 | + # To modify this workflow when other events occur, see: |
| 52 | + # - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow |
| 53 | + # - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows |
| 54 | + # - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on |
| 55 | + # |
| 56 | + # Note that some steps may depend on context variables that are only |
| 57 | + # available for release events, so if you add other events, you may need to |
| 58 | + # alter other parts of this workflow. |
| 59 | + release: |
| 60 | + types: [published] |
64 | 61 |
|
65 | 62 | jobs: |
66 | | - build: |
67 | | - runs-on: ubuntu-latest |
68 | | - permissions: |
69 | | - contents: write |
70 | | - |
71 | | - steps: |
72 | | - - name: Checkout Repository |
73 | | - uses: actions/checkout@v4 |
74 | | - |
75 | | - |
76 | | - # Install @foundryvtt/foundryvtt-cli package |
77 | | - - name: Install foundryvtt-cli |
78 | | - run: npm install @foundryvtt/foundryvtt-cli |
79 | | - |
80 | | - # Extract version embedded in the tag. |
81 | | - # This step expects the tag to be one of the following formats: |
82 | | - # - "v<major>.<minor>.<patch>" (e.g., "v1.2.3") |
83 | | - # - "<major>.<minor>.<patch>" (e.g., "1.2.3") |
84 | | - # |
85 | | - # The version will be used by later steps to fill in the value for the |
86 | | - # "version" key required for a valid system manifest. |
87 | | - - name: Extract Version From Tag |
88 | | - id: get_version |
89 | | - uses: battila7/get-version-action@v2 |
90 | | - |
91 | | - |
92 | | - # Modify "system.json" with values specific to the release. |
93 | | - # Since the values for the "version" and "url" keys aren't known ahead of |
94 | | - # time, the manifest file in the repository is updated with these values. |
95 | | - # |
96 | | - # While this does modify the manifest file in-place, the changes are not |
97 | | - # commited to the repository, and only exist in the action's filesystem. |
98 | | - - name: Modify System Manifest With Release-Specific Values |
99 | | - id: sub_manifest_link_version |
100 | | - uses: cschleiden/replace-tokens@v1 |
101 | | - with: |
102 | | - files: 'system.json' |
103 | | - env: |
104 | | - VERSION: ${{steps.get_version.outputs.version-without-v}} |
105 | | - URL: ${{ env.project_url }} |
106 | | - MANIFEST: ${{ env.latest_manifest_url }} |
107 | | - DOWNLOAD: ${{ env.release_system_url }} |
108 | | - |
109 | | - # Run npm script to convert YML to LDB before creating release |
110 | | - - name: Convert YML to LDB |
111 | | - run: npm run pullYMLtoLDB |
112 | | - working-directory: ./tools |
113 | | - |
114 | | - # Create a "fabulaultima.zip" archive containing all the system's required files. |
115 | | - # If you have other directories or files that will need to be added to |
116 | | - # your packaged system, add them here. |
117 | | - - name: Create System Archive |
118 | | - run: | |
119 | | - # Note that `zip` will only emit warnings when a file or directory |
120 | | - # doesn't exist, it will not fail. |
121 | | - zip \ |
122 | | - `# Options` \ |
123 | | - --recurse-paths \ |
124 | | - `# The name of the output file` \ |
125 | | - ./fabulaultima.zip \ |
126 | | - `# The files that will be included.` \ |
127 | | - template.json \ |
128 | | - system.json \ |
129 | | - README.md \ |
130 | | - LICENSE.md \ |
131 | | - CHANGELOG.md \ |
132 | | - templates \ |
133 | | - scripts/ \ |
134 | | - styles/ \ |
135 | | - packs/ \ |
136 | | - module \ |
137 | | - language/ \ |
138 | | - lang/ |
139 | | - # Don't forget to add a backslash at the end of the line for any |
140 | | - # additional files or directories! |
141 | | -
|
142 | | -
|
143 | | - # Update the GitHub release with the manifest and system archive files. |
144 | | - - name: Update Release With Files |
145 | | - id: create_version_release |
146 | | - uses: ncipollo/release-action@v1 |
147 | | - with: |
148 | | - allowUpdates: true |
149 | | - name: ${{ github.event.release.name }} |
150 | | - draft: ${{ github.event.release.unpublished }} |
151 | | - prerelease: ${{ github.event.release.prerelease }} |
152 | | - token: ${{ secrets.GITHUB_TOKEN }} |
153 | | - artifacts: './system.json, ./fabulaultima.zip' |
154 | | - tag: ${{ github.event.release.tag_name }} |
155 | | - body: ${{ github.event.release.body }} |
| 63 | + build: |
| 64 | + runs-on: ubuntu-latest |
| 65 | + permissions: |
| 66 | + contents: write |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Checkout Repository |
| 70 | + uses: actions/checkout@v4 |
| 71 | + |
| 72 | + # Install @foundryvtt/foundryvtt-cli package |
| 73 | + - name: Install foundryvtt-cli |
| 74 | + run: npm install @foundryvtt/foundryvtt-cli |
| 75 | + |
| 76 | + # Extract version embedded in the tag. |
| 77 | + # This step expects the tag to be one of the following formats: |
| 78 | + # - "v<major>.<minor>.<patch>" (e.g., "v1.2.3") |
| 79 | + # - "<major>.<minor>.<patch>" (e.g., "1.2.3") |
| 80 | + # |
| 81 | + # The version will be used by later steps to fill in the value for the |
| 82 | + # "version" key required for a valid system manifest. |
| 83 | + - name: Extract Version From Tag |
| 84 | + id: get_version |
| 85 | + uses: battila7/get-version-action@v2 |
| 86 | + |
| 87 | + # Modify "system.json" with values specific to the release. |
| 88 | + # Since the values for the "version" and "url" keys aren't known ahead of |
| 89 | + # time, the manifest file in the repository is updated with these values. |
| 90 | + # |
| 91 | + # While this does modify the manifest file in-place, the changes are not |
| 92 | + # commited to the repository, and only exist in the action's filesystem. |
| 93 | + - name: Modify System Manifest With Release-Specific Values |
| 94 | + id: sub_manifest_link_version |
| 95 | + uses: cschleiden/replace-tokens@v1 |
| 96 | + with: |
| 97 | + files: 'system.json' |
| 98 | + env: |
| 99 | + VERSION: ${{steps.get_version.outputs.version-without-v}} |
| 100 | + URL: ${{ env.project_url }} |
| 101 | + MANIFEST: ${{ env.latest_manifest_url }} |
| 102 | + DOWNLOAD: ${{ env.release_system_url }} |
| 103 | + |
| 104 | + # Run npm script to convert YML to LDB before creating release |
| 105 | + - name: Convert YML to LDB |
| 106 | + run: npm run pullYMLtoLDB |
| 107 | + working-directory: ./tools |
| 108 | + |
| 109 | + # Create a "fabulaultima.zip" archive containing all the system's required files. |
| 110 | + # If you have other directories or files that will need to be added to |
| 111 | + # your packaged system, add them here. |
| 112 | + - name: Create System Archive |
| 113 | + run: | |
| 114 | + # Note that `zip` will only emit warnings when a file or directory |
| 115 | + # doesn't exist, it will not fail. |
| 116 | + zip \ |
| 117 | + `# Options` \ |
| 118 | + --recurse-paths \ |
| 119 | + `# The name of the output file` \ |
| 120 | + ./fabulaultima.zip \ |
| 121 | + `# The files that will be included.` \ |
| 122 | + template.json \ |
| 123 | + system.json \ |
| 124 | + README.md \ |
| 125 | + LICENSE.md \ |
| 126 | + CHANGELOG.md \ |
| 127 | + templates \ |
| 128 | + scripts/ \ |
| 129 | + styles/ \ |
| 130 | + packs/ \ |
| 131 | + module \ |
| 132 | + language/ \ |
| 133 | + lang/ |
| 134 | + # Don't forget to add a backslash at the end of the line for any |
| 135 | + # additional files or directories! |
| 136 | +
|
| 137 | + # Update the GitHub release with the manifest and system archive files. |
| 138 | + - name: Update Release With Files |
| 139 | + id: create_version_release |
| 140 | + uses: ncipollo/release-action@v1 |
| 141 | + with: |
| 142 | + allowUpdates: true |
| 143 | + name: ${{ github.event.release.name }} |
| 144 | + draft: ${{ github.event.release.unpublished }} |
| 145 | + prerelease: ${{ github.event.release.prerelease }} |
| 146 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 147 | + artifacts: './system.json, ./fabulaultima.zip' |
| 148 | + tag: ${{ github.event.release.tag_name }} |
| 149 | + body: ${{ github.event.release.body }} |
0 commit comments