name: Release Creation on: release: types: [published] jobs: build: runs-on: ubuntu-latest steps: - run: echo "💡 The ${{ gitea.repository }} repository will be cloned to the runner." - uses: https://github.com/RouxAntoine/checkout@v3.5.4 # get part of the tag after the `v` - name: Extract tag version number id: get_version uses: https://github.com/battila7/get-version-action@v2 # Compile SCSS → CSS before packaging - name: Setup Node.js uses: https://github.com/actions/setup-node@v3 with: node-version: '18' - name: Install dependencies and compile styles run: npm ci && npm run compile # Substitute the Manifest and Download URLs in system.json - name: Substitute Manifest and Download Links For Versioned Ones id: sub_manifest_link_version uses: https://github.com/microsoft/variable-substitution@v1 with: files: "system/system.json" env: version: ${{steps.get_version.outputs.version-without-v}} url: https://www.uberwald.me/gitea/uberwald/l5rx-chiaroscuro manifest: https://www.uberwald.me/gitea/uberwald/l5rx-chiaroscuro/releases/download/latest/system.json download: https://www.uberwald.me/gitea/uberwald/l5rx-chiaroscuro/releases/download/${{github.event.release.tag_name}}/l5rx-chiaroscuro.zip # Copy versioned system.json to root so it can be uploaded as-is - name: Copy system.json to root run: cp system/system.json system.json # Create a zip file with all files required by the system - run: | apt update -y apt install -y zip - run: | cd system zip -r ../l5rx-chiaroscuro.zip \ assets/ \ babele/ \ fonts/ \ lang/ \ lib/ \ macros/ \ packs/ \ scripts/ \ styles/ \ templates/ \ system.json \ template.json cd .. zip -j ./l5rx-chiaroscuro.zip README.md CHANGELOG.md LICENSE.md - name: Setup Go uses: https://github.com/actions/setup-go@v4 with: go-version: ">=1.20.1" - name: Upload release assets to Gitea id: use-go-action uses: https://gitea.com/actions/release-action@main with: files: |- ./l5rx-chiaroscuro.zip system.json api_key: "${{secrets.ALLOW_PUSH_RELEASE}}" - name: Publish to Foundry server uses: https://github.com/djlechuck/foundryvtt-publish-package-action@v1 with: token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }} id: 'l5rx-chiaroscuro' version: ${{github.event.release.tag_name}} manifest: 'https://www.uberwald.me/gitea/uberwald/l5rx-chiaroscuro/releases/download/latest/system.json' notes: 'https://www.uberwald.me/gitea/uberwald/l5rx-chiaroscuro/releases/tag/${{github.event.release.tag_name}}' compatibility-minimum: '13' compatibility-verified: '14'