Skip to content

Commit 3029588

Browse files
committed
ci: git tag proper settings
1 parent 09133fb commit 3029588

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

.github/workflows/tauri-build-dev.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
with:
2020
node-version: lts/*
2121
- name: get version
22-
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
22+
run: |
23+
echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
24+
echo "GIT_TAG_NAME=dev-app-v$(node -p "require('./package.json').version")" >> $GITHUB_ENV
2325
- name: create release
2426
id: create-release
2527
uses: actions/github-script@v6
@@ -28,7 +30,8 @@ jobs:
2830
const { data } = await github.rest.repos.createRelease({
2931
owner: context.repo.owner,
3032
repo: context.repo.repo,
31-
tag_name: `app-v${process.env.PACKAGE_VERSION}`,
33+
tag_name: `${process.env.GIT_TAG_NAME}`,
34+
target_commitish: 'dev',
3235
name: `Phoenix Code Experimental build v${process.env.PACKAGE_VERSION}`,
3336
body: 'Take a look at the assets to download and install Phoenix Code For your platform.\n\n>UpdateNotification: <replace this text to show a 1 line **Release Notes** to the user in the notification dialogue ![image](https://github.com/abose/phoenix-desktop/assets/5336369/c747898a-29ef-43c7-b74e-dddd5104a56c). Wait for a new pull request in the repo.>',
3437
draft: true,
@@ -121,7 +124,7 @@ jobs:
121124
with:
122125
releaseId: ${{ needs.create-release.outputs.release_id }}
123126
updaterJsonPreferNsis: true
124-
tagName: app-v__VERSION__
127+
tagName: ${{ env.GIT_TAG_NAME }}
125128

126129
- name: setup env for mac arm (Mac only)
127130
if: matrix.platform == 'macos-latest'
@@ -144,7 +147,7 @@ jobs:
144147
with:
145148
releaseId: ${{ needs.create-release.outputs.release_id }}
146149
args: --target aarch64-apple-darwin
147-
tagName: app-v__VERSION__
150+
tagName: ${{ env.GIT_TAG_NAME }}
148151

149152
publish-release:
150153
permissions:
@@ -163,6 +166,8 @@ jobs:
163166
github.rest.repos.updateRelease({
164167
owner: context.repo.owner,
165168
repo: context.repo.repo,
169+
tag_name: `${process.env.GIT_TAG_NAME}`,
170+
target_commitish: 'dev',
166171
release_id: process.env.release_id,
167172
draft: true,
168173
prerelease: true

.github/workflows/tauri-build-prod.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
with:
2020
node-version: lts/*
2121
- name: get version
22-
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
22+
run: |
23+
echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
24+
echo "GIT_TAG_NAME=prod-app-v$(node -p "require('./package.json').version")" >> $GITHUB_ENV
2325
- name: create release
2426
id: create-release
2527
uses: actions/github-script@v6
@@ -28,7 +30,8 @@ jobs:
2830
const { data } = await github.rest.repos.createRelease({
2931
owner: context.repo.owner,
3032
repo: context.repo.repo,
31-
tag_name: `app-v${process.env.PACKAGE_VERSION}`,
33+
tag_name: `${process.env.GIT_TAG_NAME}`,
34+
target_commitish: 'prod',
3235
name: `Phoenix Code Stable Release v${process.env.PACKAGE_VERSION}`,
3336
body: 'Take a look at the assets to download and install Phoenix Code For your platform.\n\n>UpdateNotification: <replace this text to show a 1 line **Release Notes** to the user in the notification dialogue ![image](https://github.com/abose/phoenix-desktop/assets/5336369/c747898a-29ef-43c7-b74e-dddd5104a56c). Wait for a new pull request in the repo.>',
3437
draft: true,
@@ -121,7 +124,7 @@ jobs:
121124
with:
122125
releaseId: ${{ needs.create-release.outputs.release_id }}
123126
updaterJsonPreferNsis: true
124-
tagName: app-v__VERSION__
127+
tagName: ${{ env.GIT_TAG_NAME }}
125128

126129
- name: setup env for mac arm (Mac only)
127130
if: matrix.platform == 'macos-latest'
@@ -144,7 +147,7 @@ jobs:
144147
with:
145148
releaseId: ${{ needs.create-release.outputs.release_id }}
146149
args: --target aarch64-apple-darwin
147-
tagName: app-v__VERSION__
150+
tagName: ${{ env.GIT_TAG_NAME }}
148151

149152

150153
publish-release:
@@ -164,6 +167,8 @@ jobs:
164167
github.rest.repos.updateRelease({
165168
owner: context.repo.owner,
166169
repo: context.repo.repo,
170+
tag_name: `${process.env.GIT_TAG_NAME}`,
171+
target_commitish: 'dev',
167172
release_id: process.env.release_id,
168173
draft: true,
169174
prerelease: false

.github/workflows/tauri-build-staging.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
with:
2020
node-version: lts/*
2121
- name: get version
22-
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
22+
run: |
23+
echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
24+
echo "GIT_TAG_NAME=staging-app-v$(node -p "require('./package.json').version")" >> $GITHUB_ENV
2325
- name: create release
2426
id: create-release
2527
uses: actions/github-script@v6
@@ -28,7 +30,8 @@ jobs:
2830
const { data } = await github.rest.repos.createRelease({
2931
owner: context.repo.owner,
3032
repo: context.repo.repo,
31-
tag_name: `app-v${process.env.PACKAGE_VERSION}`,
33+
tag_name: `${process.env.GIT_TAG_NAME}`,
34+
target_commitish: 'staging',
3235
name: `Phoenix Code Pre-release v${process.env.PACKAGE_VERSION}`,
3336
body: 'Take a look at the assets to download and install Phoenix Code For your platform.\n\n>UpdateNotification: <replace this text to show a 1 line **Release Notes** to the user in the notification dialogue ![image](https://github.com/abose/phoenix-desktop/assets/5336369/c747898a-29ef-43c7-b74e-dddd5104a56c). Wait for a new pull request in the repo.>',
3437
draft: true,
@@ -121,7 +124,7 @@ jobs:
121124
with:
122125
releaseId: ${{ needs.create-release.outputs.release_id }}
123126
updaterJsonPreferNsis: true
124-
tagName: app-v__VERSION__
127+
tagName: ${{ env.GIT_TAG_NAME }}
125128

126129
- name: setup env for mac arm (Mac only)
127130
if: matrix.platform == 'macos-latest'
@@ -144,7 +147,7 @@ jobs:
144147
with:
145148
releaseId: ${{ needs.create-release.outputs.release_id }}
146149
args: --target aarch64-apple-darwin
147-
tagName: app-v__VERSION__
150+
tagName: ${{ env.GIT_TAG_NAME }}
148151

149152

150153
publish-release:
@@ -164,6 +167,8 @@ jobs:
164167
github.rest.repos.updateRelease({
165168
owner: context.repo.owner,
166169
repo: context.repo.repo,
170+
tag_name: `${process.env.GIT_TAG_NAME}`,
171+
target_commitish: 'dev',
167172
release_id: process.env.release_id,
168173
draft: true,
169174
prerelease: true

0 commit comments

Comments
 (0)