Skip to content

Commit 698aedd

Browse files
authored
Correct tag behavior (#12)
1 parent 27e32b3 commit 698aedd

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,52 @@ permissions:
1010
jobs:
1111
release:
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- name: Setup Node.js
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version: '20'
24-
23+
node-version: "20"
24+
2525
- name: Install pnpm
2626
uses: pnpm/action-setup@v4
27-
27+
2828
- name: Get pnpm store directory
2929
id: pnpm-cache
3030
shell: bash
3131
run: |
3232
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
33-
33+
3434
- name: Setup pnpm cache
3535
uses: actions/cache@v4
3636
with:
3737
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
3838
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3939
restore-keys: |
4040
${{ runner.os }}-pnpm-store-
41-
41+
4242
- name: Install dependencies
4343
run: pnpm install --frozen-lockfile
44-
44+
4545
- name: Build the action
4646
run: pnpm run build
47-
47+
4848
- name: Run tests
4949
run: pnpm run test
5050
env:
5151
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
52-
52+
5353
- name: Run type checking
5454
run: pnpm run typecheck
55-
55+
5656
- name: Run linting
5757
run: pnpm run lint
58-
58+
5959
- name: Extract version from tag
6060
id: version
6161
run: |
@@ -65,30 +65,30 @@ jobs:
6565
echo "version=$VERSION" >> $GITHUB_OUTPUT
6666
echo "major_version=v$MAJOR_VERSION" >> $GITHUB_OUTPUT
6767
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
68-
68+
6969
- name: Update package.json version
7070
run: |
7171
npm version ${{ steps.version.outputs.version }} --no-git-tag-version
72-
72+
7373
- name: Rebuild with updated version
7474
run: pnpm run build
75-
75+
7676
- name: Configure Git
7777
run: |
7878
git config user.name "github-actions[bot]"
7979
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
80-
80+
8181
- name: Commit built files
8282
run: |
8383
git add dist/ package.json
8484
git commit -m "Release ${{ steps.version.outputs.tag_name }}"
85-
86-
- name: Create or update major version tag
87-
run: |
88-
git tag -f ${{ steps.version.outputs.major_version }} ${{ steps.version.outputs.tag_name }}
89-
git push origin ${{ steps.version.outputs.major_version }} --force
90-
85+
9186
- name: Push changes to release tag
9287
run: |
9388
git tag -f ${{ steps.version.outputs.tag_name }}
94-
git push origin ${{ steps.version.outputs.tag_name }} --force
89+
git push origin ${{ steps.version.outputs.tag_name }} --force
90+
91+
- name: Create or update major version tag
92+
run: |
93+
git tag -f ${{ steps.version.outputs.major_version }}
94+
git push origin ${{ steps.version.outputs.major_version }} --force

0 commit comments

Comments
 (0)