feat: add settings.jiun.dev vanity URL via GitHub Pages #63
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: | |
| branches: | |
| - master | |
| tags: | |
| - 'v*' | |
| paths-ignore: | |
| - '**.md' | |
| - '.github/**' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag (e.g., v2.0.0) - leave empty for auto CalVer' | |
| required: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| # Skip if commit message contains [skip ci] or [no release] | |
| if: | | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !contains(github.event.head_commit.message, '[no release]') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate CalVer tag | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then | |
| # Manual version specified | |
| VERSION="${{ github.event.inputs.version }}" | |
| elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then | |
| # Tag push - use existing tag | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| else | |
| # Auto CalVer: v2025.01.06 format | |
| BASE_VERSION="v$(date -u +'%Y.%m.%d')" | |
| # Check if tag exists, add suffix if needed | |
| SUFFIX=0 | |
| VERSION="$BASE_VERSION" | |
| while git rev-parse "$VERSION" >/dev/null 2>&1; do | |
| SUFFIX=$((SUFFIX + 1)) | |
| VERSION="${BASE_VERSION}.${SUFFIX}" | |
| done | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Generated version: $VERSION" | |
| - name: Create and push tag | |
| if: startsWith(github.ref, 'refs/heads/') | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -a "${{ steps.version.outputs.version }}" -m "Release ${{ steps.version.outputs.version }}" | |
| git push origin "${{ steps.version.outputs.version }}" | |
| - name: Create bundled installer | |
| run: | | |
| chmod +x scripts/bundle.sh | |
| ./scripts/bundle.sh > install-bundled.sh | |
| chmod +x install-bundled.sh | |
| - name: Create release archive | |
| run: | | |
| ARCHIVE_NAME="settings-${{ steps.version.outputs.version }}.tar.gz" | |
| tar -czvf "/tmp/$ARCHIVE_NAME" \ | |
| --exclude='.git' \ | |
| --exclude='.github' \ | |
| --exclude='install-bundled.sh' \ | |
| . | |
| mv "/tmp/$ARCHIVE_NAME" . | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.version.outputs.version }} | |
| name: Settings ${{ steps.version.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: | | |
| install-bundled.sh | |
| settings-${{ steps.version.outputs.version }}.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |