Skip to content

Commit e37b44a

Browse files
authored
Merge pull request #6 from atlassian/Add-snapshot-release-workflow
Updated workflow condition to release snapshot versions
2 parents 06a8538 + c98e8d4 commit e37b44a

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

.github/workflows/go.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version'
7+
description: 'Version'
88
required: true
99
jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-latest
13-
if: github.ref == 'refs/heads/master'
13+
if: ${{ (github.ref == 'refs/heads/master') || endsWith(github.event.inputs.version, 'SNAPSHOT') }}
1414
steps:
1515

1616
- name: Set up Go 1.x
@@ -36,10 +36,10 @@ jobs:
3636
- name: Build Linux 64
3737
run: go build -mod=vendor -a -ldflags "-X main.JECCommitVersion=$GITHUB_SHA -X main.JECVersion=${{ github.event.inputs.version }}" -o ../.release/jec-packages-linux/JiraEdgeConnector main.go
3838
working-directory: main
39-
if: success()
39+
if: success()
4040
env:
41-
CGO_ENABLED: 0
42-
GOOS: linux
41+
CGO_ENABLED: 0
42+
GOOS: linux
4343
GOARCH: amd64
4444
GO111MODULE: on
4545

@@ -51,23 +51,23 @@ jobs:
5151
- name: Build Win 32 Service
5252
run: go build -mod=vendor -o ../../.release/jec-packages-win32/jecService32.exe jecService.go
5353
working-directory: windows_service/main
54-
if: success()
54+
if: success()
5555
env:
56-
CGO_ENABLED: 0
57-
GOOS: windows
56+
CGO_ENABLED: 0
57+
GOOS: windows
5858
GOARCH: 386
5959
GO111MODULE: on
60-
60+
6161
- name: Build Win 32
6262
run: go build -mod=vendor -a -ldflags "-X main.JECCommitVersion=$GITHUB_SHA -X main.JECVersion=${{ github.event.inputs.version }}" -o ../.release/jec-packages-win32/JiraEdgeConnector32.exe main.go
6363
working-directory: main
64-
if: success()
64+
if: success()
6565
env:
66-
CGO_ENABLED: 0
67-
GOOS: windows
66+
CGO_ENABLED: 0
67+
GOOS: windows
6868
GOARCH: 386
6969
GO111MODULE: on
70-
70+
7171
- uses: montudor/[email protected]
7272
name: Compressing Windows 32 Package
7373
with:
@@ -76,23 +76,23 @@ jobs:
7676
- name: Build Win 64 Service
7777
run: go build -mod=vendor -o ../../.release/jec-packages-win64/jecService64.exe jecService.go
7878
working-directory: windows_service/main
79-
if: success()
79+
if: success()
8080
env:
81-
CGO_ENABLED: 0
82-
GOOS: windows
81+
CGO_ENABLED: 0
82+
GOOS: windows
8383
GOARCH: amd64
8484
GO111MODULE: on
85-
85+
8686
- name: Build Win 64
8787
run: go build -mod=vendor -a -ldflags "-X main.JECCommitVersion=$GITHUB_SHA -X main.JECVersion=${{ github.event.inputs.version }}" -o ../.release/jec-packages-win64/JiraEdgeConnector64.exe main.go
8888
working-directory: main
89-
if: success()
89+
if: success()
9090
env:
91-
CGO_ENABLED: 0
92-
GOOS: windows
91+
CGO_ENABLED: 0
92+
GOOS: windows
9393
GOARCH: amd64
9494
GO111MODULE: on
95-
95+
9696
- uses: montudor/[email protected]
9797
name: Compressing Windows 64 Package
9898
with:
@@ -108,7 +108,7 @@ jobs:
108108
release_name: Release ${{ github.event.inputs.version }}
109109
draft: true
110110

111-
- name: Upload Linux 64 bit Release
111+
- name: Upload Linux 64 bit Release
112112
uses: actions/upload-release-asset@v1
113113
env:
114114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -118,7 +118,7 @@ jobs:
118118
asset_name: jec-linux-amd64-${{ github.event.inputs.version }}.zip
119119
asset_content_type: application/zip
120120

121-
- name: Upload Win 32 bit Release
121+
- name: Upload Win 32 bit Release
122122
uses: actions/upload-release-asset@v1
123123
env:
124124
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -128,7 +128,7 @@ jobs:
128128
asset_name: jec-win-386-${{ github.event.inputs.version }}.zip
129129
asset_content_type: application/zip
130130

131-
- name: Upload Win 64 bit Release
131+
- name: Upload Win 64 bit Release
132132
uses: actions/upload-release-asset@v1
133133
env:
134134
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -137,8 +137,8 @@ jobs:
137137
asset_path: .release/jec-win-amd64-${{ github.event.inputs.version }}.zip
138138
asset_name: jec-win-amd64-${{ github.event.inputs.version }}.zip
139139
asset_content_type: application/zip
140-
141-
- name: Upload Artifacts
140+
141+
- name: Upload Artifacts
142142
uses: actions/upload-artifact@v2
143143
with:
144144
name: Release Artifacts

0 commit comments

Comments
 (0)