chore: bump version to 1.2.0 #1
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: Publish on Tag | |
| # Only runs when you create a tag like v1.2.3 | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Get version from tag | |
| id: get_version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing version: $VERSION" | |
| - name: Verify version matches files | |
| run: | | |
| TAG_VERSION="${{ steps.get_version.outputs.version }}" | |
| PYPROJECT_VERSION=$(python -c "import tomllib; f = open('pyproject.toml', 'rb'); data = tomllib.load(f); print(data['project']['version'])") | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| echo "Tag version: $TAG_VERSION" | |
| echo "pyproject.toml version: $PYPROJECT_VERSION" | |
| echo "package.json version: $PACKAGE_VERSION" | |
| if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ] || [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then | |
| echo "❌ Version mismatch!" | |
| echo "Please ensure all versions match before tagging:" | |
| echo " - Tag: v$TAG_VERSION" | |
| echo " - pyproject.toml: $PYPROJECT_VERSION" | |
| echo " - package.json: $PACKAGE_VERSION" | |
| exit 1 | |
| fi | |
| echo "✅ All versions match!" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build Python package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create GitHub Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ steps.get_version.outputs.version }} | |
| release_name: Release v${{ steps.get_version.outputs.version }} | |
| body: | | |
| ## Installation | |
| ```bash | |
| # npm | |
| npm install -g git-quick-cli@${{ steps.get_version.outputs.version }} | |
| # pip | |
| pip install git-quick==${{ steps.get_version.outputs.version }} | |
| ``` | |
| See [CHANGELOG](https://github.com/${{ github.repository }}/compare/v${{ steps.get_version.outputs.version }}...main) for details. | |
| draft: false | |
| prerelease: false |