chore: Update .gitignore to include .pnpm-store and add dotenv packag… #18
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 Tags | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| actions: write | |
| contents: write | |
| jobs: | |
| tag: | |
| name: Tag versioned packages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Create package tags | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| declare -A packages=( | |
| ["api"]="backend/api/package.json" | |
| ["auth"]="backend/auth/package.json" | |
| ["cli"]="frontend/apps/cli/package.json" | |
| ["app"]="frontend/apps/app/package.json" | |
| ["shared"]="frontend/packages/shared/package.json" | |
| ) | |
| for package in "${!packages[@]}"; do | |
| path="${packages[$package]}" | |
| if ! git diff --name-only HEAD^ HEAD -- "$path" | grep -q .; then | |
| continue | |
| fi | |
| if git cat-file -e "HEAD^:$path" 2>/dev/null; then | |
| previous="$(git show "HEAD^:$path" | jq -r .version)" | |
| else | |
| previous="" | |
| fi | |
| current="$(jq -r .version "$path")" | |
| if [ "$previous" = "$current" ]; then | |
| continue | |
| fi | |
| tag="${package}@v${current}" | |
| if git ls-remote --tags origin "refs/tags/$tag" | grep -q "$tag"; then | |
| echo "Tag $tag already exists" | |
| else | |
| git tag "$tag" | |
| git push origin "$tag" | |
| fi | |
| gh workflow run release.yml --ref main -f tag="$tag" | |
| done | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |