Version Packages (#8) #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to build' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ inputs.tag || github.ref }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Lint | |
| run: npm run lint | |
| - name: Format | |
| run: npm run format:check | |
| - name: Check deps | |
| run: npm run check:deps | |
| - name: Build | |
| env: | |
| FXMC_LOG_LEVEL: error | |
| FXMC_VERSION: ${{ github.ref_name }} | |
| FXMC_REPO_URL: ${{ github.server_url }}/${{ github.repository }} | |
| FXMC_PROJECT_NAME: FX Media Controller | |
| run: npm run build | |
| - name: Prepare release | |
| run: | | |
| mkdir release | |
| cp dist/fx-media-controller.js \ | |
| release/ | |
| cp styles/fx-media-controller.css \ | |
| release/ | |
| cp program/autoconfig.js \ | |
| release/ | |
| cp program/autoconfig.cfg \ | |
| release/ | |
| cp README.md \ | |
| release/ | |
| if [ -f LICENSE ]; then | |
| cp LICENSE release/ | |
| fi | |
| - name: Create archive | |
| run: | | |
| cd release | |
| zip -r \ | |
| ../fx-media-controller-${{ inputs.tag || github.ref_name }}.zip . | |
| - name: Generate checksum | |
| run: | | |
| sha256sum \ | |
| fx-media-controller-${{ inputs.tag || github.ref_name }}.zip \ | |
| > fx-media-controller-${{ inputs.tag || github.ref_name }}.zip.sha256 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ inputs.tag || github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| fx-media-controller-${{ inputs.tag || github.ref_name }}.zip | |
| fx-media-controller-${{ inputs.tag || github.ref_name }}.zip.sha256 | |
| fail_on_unmatched_files: true |