88
99permissions :
1010 contents : write # needed for creating releases
11- packages : write # if you're also publishing packages
1211
1312jobs :
1413 release :
1514 if : ${{ github.repository_owner == 'your-ehsan' && github.event.pull_request.merged}}
1615 name : Create a release
17- runs-on : windows -latest
16+ runs-on : ubuntu -latest
1817
1918 steps :
2019 - name : Check out Git repository
2120 uses : actions/checkout@v4
2221 with :
2322 fetch-depth : 0
2423
25- - name : Get the latest tag
24+ - name : Get the latest tag from development
2625 id : get_tag
27- run : echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
28-
29- - name : Verify if the PR contains a tag
3026 run : |
31- if [ -z "${{ env.LATEST_TAG }}" ]; then
27+ LATEST_TAG=$(git tag --sort=-creatordate | head -n 1)
28+ if [ -z "$LATEST_TAG" ]; then
3229 echo "No tag found. Skipping release."
3330 exit 1
34- else
35- echo "Latest tag: ${{ env.LATEST_TAG }}"
3631 fi
32+ echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT
3733
3834 - name : Install pnpm
3935 uses : pnpm/action-setup@v4
@@ -48,13 +44,14 @@ jobs:
4844
4945 - name : Get pnpm store directory
5046 shell : bash
47+ id : get_store_path
5148 run : |
52- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
49+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
5350
5451 - name : Setup pnpm cache
5552 uses : actions/cache@v4
5653 with :
57- path : ${{ env .STORE_PATH }}
54+ path : ${{ steps.get_store_path.outputs .STORE_PATH }}
5855 key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
5956 restore-keys : |
6057 ${{ runner.os }}-pnpm-store-
8784 dist/*.exe
8885 dist/latest.yml
8986 body_path : CHANGELOG.md
90- tag_name : ${{ env .LATEST_TAG }}
87+ tag_name : ${{ steps.get_tag.outputs .LATEST_TAG }}
9188 draft : false
9289 generate_release_notes : true
9390 prerelease : false
0 commit comments