diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d41aa0..c91d7d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,24 +14,29 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Write raw version to env + run: | + echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV" - name: Substitute version in manifest uses: microsoft/variable-substitution@v1 with: files: 'system.json' env: - version: ${GITHUB_REF_NAME#v} - manifest: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.json - download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/candelafvtt-${GITHUB_REF_NAME}.zip + version: ${{ env.VERSION }} + download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/candelafvtt-${{github.event.release.tag_name}}.zip - name: Install dependencies and build run: | npm install -g yarn yarn install - sh build.sh ${GITHUB_REF_NAME#v} + sh build.sh ${{ env.VERSION }} + - name: Update release with files + uses: ncipollo/release-action@v1 with: + allowUpdates: true name: ${{ github.event.release.name }} draft: false token: ${{ secrets.GITHUB_TOKEN }} - artifacts: './system.json, ./dist/candelafvtt-${GITHUB_REF_NAME}.zip' + artifacts: 'dist/system.json,dist/candelafvtt-v${{ env.VERSION }}.zip' tag: ${{ github.event.release.tag_name }} - body: ${{ github.event.release.body }} + body: ${{ github.event.release.body }} \ No newline at end of file diff --git a/build.sh b/build.sh index 07da88c..257494d 100755 --- a/build.sh +++ b/build.sh @@ -10,4 +10,5 @@ rm -rf dist/ mkdir dist yarn gulp build yarn gulp pack -zip -r dist/candelafvtt-v${1}.zip css/ img/ lang/ module/ packs/ templates/ ./CHANGELOG.md ./LICENSE.txt ./NOTES.md ./system.json ./template.json -x "packs/src/*" \ No newline at end of file +zip -r dist/candelafvtt-v${1}.zip css/ img/ lang/ module/ packs/ templates/ ./CHANGELOG.md ./LICENSE.txt ./NOTES.md ./system.json ./template.json -x "packs/src/*" +cp system.json dist/ \ No newline at end of file