File tree Expand file tree Collapse file tree 2 files changed +28
-10
lines changed Expand file tree Collapse file tree 2 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 14
14
branches :
15
15
- master
16
16
release :
17
- branches :
18
- - master
19
17
types :
20
18
- released
21
19
jobs :
25
23
strategy :
26
24
matrix :
27
25
os : [ubuntu-latest, windows-latest, macOS-latest]
26
+ outputs :
27
+ taggedbranch : ${{ steps.find-branch.outputs.taggedbranch }}
28
28
steps :
29
29
- uses : actions/checkout@v2
30
30
- run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
31
+ - name : Find which branch the release tag points at
32
+ id : find-branch
33
+ if : github.event_name == 'release' && runner.os == 'Linux'
34
+ shell : bash
35
+ run : |
36
+ git fetch --depth=1 origin +refs/heads/*:refs/heads/*
37
+ set -x
38
+ TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
39
+ echo ::set-output name=taggedbranch::$TAGGEDBRANCH
31
40
- name : Set an output
32
41
id : set-version
33
42
if : runner.os == 'Linux'
67
76
run : |
68
77
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
69
78
- uses : actions/upload-artifact@v2
70
- if : runner.os == 'Linux'
79
+ if : ( runner.os == 'Linux') && (github.event_name != 'release')
71
80
with :
72
81
name : ${{ steps.set-version.outputs.name }}.vsix
73
82
path : ${{ steps.set-version.outputs.name }}.vsix
@@ -122,9 +131,9 @@ jobs:
122
131
asset_name : ${{ steps.set-version.outputs.name }}.vsix
123
132
asset_content_type : application/zip
124
133
publish :
125
- if : github.event_name == 'release'
126
- runs-on : ubuntu-latest
127
134
needs : build
135
+ if : github.event_name == 'release' && needs.build.outputs.taggedbranch == 'master'
136
+ runs-on : ubuntu-latest
128
137
steps :
129
138
- uses : actions/checkout@v2
130
139
with :
Original file line number Diff line number Diff line change 14
14
branches :
15
15
- prerelease
16
16
release :
17
- branches :
18
- - prerelease
19
17
types :
20
18
- released
21
19
jobs :
25
23
strategy :
26
24
matrix :
27
25
os : [ubuntu-latest, windows-latest, macOS-latest]
26
+ outputs :
27
+ taggedbranch : ${{ steps.find-branch.outputs.taggedbranch }}
28
28
steps :
29
29
- uses : actions/checkout@v2
30
30
- run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
31
+ - name : Find which branch the release tag points at
32
+ id : find-branch
33
+ if : github.event_name == 'release' && runner.os == 'Linux'
34
+ shell : bash
35
+ run : |
36
+ git fetch --depth=1 origin +refs/heads/*:refs/heads/*
37
+ set -x
38
+ TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
39
+ echo ::set-output name=taggedbranch::$TAGGEDBRANCH
31
40
- name : Set an output
32
41
id : set-version
33
42
if : runner.os == 'Linux'
67
76
run : |
68
77
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
69
78
- uses : actions/upload-artifact@v2
70
- if : runner.os == 'Linux'
79
+ if : ( runner.os == 'Linux') && (github.event_name != 'release')
71
80
with :
72
81
name : ${{ steps.set-version.outputs.name }}.vsix
73
82
path : ${{ steps.set-version.outputs.name }}.vsix
@@ -122,9 +131,9 @@ jobs:
122
131
asset_name : ${{ steps.set-version.outputs.name }}.vsix
123
132
asset_content_type : application/zip
124
133
publish :
125
- if : github.event_name == 'release'
126
- runs-on : ubuntu-latest
127
134
needs : build
135
+ if : github.event_name == 'release' && needs.build.outputs.taggedbranch == 'prerelease'
136
+ runs-on : ubuntu-latest
128
137
steps :
129
138
- uses : actions/checkout@v2
130
139
with :
You can’t perform that action at this time.
0 commit comments