Release (artifacts + signing) #12
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g., v1.0.0)' | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install Dependencies & Build UI | |
| working-directory: web | |
| run: | | |
| npm ci | |
| npm run build | |
| env: | |
| APP_VERSION: ${{ inputs.version }} | |
| - name: Check for dist directory | |
| run: | | |
| if [ ! -d "web/dist" ]; then | |
| echo "Error: web/dist directory not found after build" | |
| exit 1 | |
| fi | |
| - name: Commit UI Build | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -f web/dist | |
| git commit -m "chore: build ui for release ${INPUT_VERSION} [skip ci]" || echo "No changes to commit" | |
| env: | |
| INPUT_VERSION: ${{ inputs.version }} | |
| - name: Create Tag | |
| run: | | |
| git tag ${INPUT_VERSION} | |
| git push origin ${INPUT_VERSION} | |
| env: | |
| INPUT_VERSION: ${{ inputs.version }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ inputs.version }} | |
| generate_release_notes: true |