Skip to content

Commit e1d8b8a

Browse files
committed
Draft release when update branch is merged
Not completely sure this is correct, but will debug with the next release.
1 parent 1605d68 commit e1d8b8a

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/release.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
version:
77
type: string
88
required: true
9+
pull_request_target:
10+
types:
11+
- closed
12+
branches:
13+
- 'update/**'
914

1015
permissions:
1116
contents: write # For creating releases.
@@ -21,6 +26,7 @@ jobs:
2126
package-linux:
2227
name: ${{ format('linux-{0}', matrix.vscode_arch) }}
2328
runs-on: ubuntu-22.04
29+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
2430

2531
strategy:
2632
matrix:
@@ -39,7 +45,7 @@ jobs:
3945
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4046
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
4147
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
42-
TAG: ${{ inputs.version || github.ref_name }}
48+
TAG: ${{ inputs.version || github.event.pull_request.head.ref || github.ref_name }}
4349
# Set release package name.
4450
ARCH: ${{ matrix.package_arch }}
4551
# Cross-compile target.
@@ -64,9 +70,10 @@ jobs:
6470
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
6571
echo "$HOME/.local/bin" >> $GITHUB_PATH
6672
67-
- name: Set version to tag without leading v
73+
- name: Strip update/ and v from tag
6874
run: |
69-
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
75+
version=${TAG#update/}
76+
echo "VERSION=${version#v}" >> $GITHUB_ENV
7077
7178
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7279
with:
@@ -118,6 +125,7 @@ jobs:
118125
package-macos:
119126
name: ${{ matrix.vscode_target }}
120127
runs-on: ${{ matrix.os }}
128+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request_merged == true
121129
strategy:
122130
matrix:
123131
include:
@@ -144,9 +152,10 @@ jobs:
144152
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
145153
echo "$HOME/.local/bin" >> $GITHUB_PATH
146154
147-
- name: Set version to tag without leading v
155+
- name: Strip update/ and v from tag
148156
run: |
149-
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
157+
version=${TAG#update/}
158+
echo "VERSION=${version#v}" >> $GITHUB_ENV
150159
151160
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
152161
with:

0 commit comments

Comments
 (0)