Skip to content

Commit 7817322

Browse files
authored
Release from github action (#18)
1 parent 9fdb395 commit 7817322

File tree

2 files changed

+53
-42
lines changed

2 files changed

+53
-42
lines changed

.github/workflows/release.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2019 Iguazio
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
name: Release
16+
17+
on:
18+
release:
19+
types:
20+
- created
21+
22+
jobs:
23+
release:
24+
name: Release Binary (${{ matrix.os }}:${{ matrix.arch }})
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
arch: [ amd64 ]
29+
os: [ linux, darwin, windows ]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- uses: actions/setup-go@v3
35+
with:
36+
cache: true
37+
go-version-file: "go.mod"
38+
39+
- name: Build binary
40+
run: make v3ctl-bin
41+
env:
42+
GOOS: ${{ matrix.os }}
43+
GOARCH: ${{ matrix.arch }}
44+
V3CTL_TAG: ${{ github.event.release.tag_name }}
45+
V3CTL_SRC_PATH: ${{ github.workspace }}
46+
V3CTL_BIN_PATH: ${{ github.workspace }}/bin
47+
48+
- name: Upload binaries (${{ matrix.os }}:${{ matrix.arch }})
49+
uses: AButler/upload-release-assets@v2.0.2
50+
with:
51+
release-tag: ${{ github.event.release.tag_name }}
52+
files: bin/v3ctl-*
53+
repo-token: ${{ secrets.GITHUB_TOKEN }}

Jenkinsfile

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ podTemplate(label: "${git_project}-${label}", inheritFrom: "jnlp-docker-golang1.
2222
RELEASE_ID = github.get_release_id(git_project, git_project_user, "${github.TAG_VERSION}", GIT_TOKEN)
2323
}
2424
}
25-
2625
stage('get dependencies') {
2726
container('golang') {
2827
dir("${github.BUILD_FOLDER}/src/github.com/v3io/${git_project}") {
2928
common.shellc("make get-dependencies")
3029
}
3130
}
3231
}
33-
3432
parallel(
3533
'build linux binaries': {
3634
container('golang') {
@@ -41,34 +39,8 @@ podTemplate(label: "${git_project}-${label}", inheritFrom: "jnlp-docker-golang1.
4139
}
4240
}
4341
},
44-
'build darwin binaries': {
45-
container('golang') {
46-
stage('build darwin binaries') {
47-
dir("${github.BUILD_FOLDER}/src/github.com/${git_project_upstream_user}/${git_project}") {
48-
common.shellc("V3CTL_SRC_PATH=\$(pwd) V3CTL_BIN_PATH=\$(pwd) V3CTL_TAG=${github.TAG_VERSION} GOARCH=amd64 GOOS=darwin make v3ctl-bin")
49-
}
50-
}
51-
}
52-
},
53-
'build windows binaries': {
54-
container('golang') {
55-
stage('build windows binaries') {
56-
dir("${github.BUILD_FOLDER}/src/github.com/${git_project_upstream_user}/${git_project}") {
57-
common.shellc("V3CTL_SRC_PATH=\$(pwd) V3CTL_BIN_PATH=\$(pwd) V3CTL_TAG=${github.TAG_VERSION} GOARCH=amd64 GOOS=windows make v3ctl-bin")
58-
}
59-
}
60-
}
61-
}
6242
)
63-
6443
parallel(
65-
'upload linux binaries': {
66-
container('jnlp') {
67-
stage('upload linux binaries') {
68-
github.upload_asset(git_project, git_project_user, "v3ctl-${github.TAG_VERSION}-linux-amd64", RELEASE_ID, GIT_TOKEN)
69-
}
70-
}
71-
},
7244
'upload linux binaries artifactory': {
7345
container('jnlp') {
7446
stage('upload linux binaries artifactory') {
@@ -80,20 +52,6 @@ podTemplate(label: "${git_project}-${label}", inheritFrom: "jnlp-docker-golang1.
8052
}
8153
}
8254
},
83-
'upload darwin binaries': {
84-
container('jnlp') {
85-
stage('upload darwin binaries') {
86-
github.upload_asset(git_project, git_project_user, "v3ctl-${github.TAG_VERSION}-darwin-amd64", RELEASE_ID, GIT_TOKEN)
87-
}
88-
}
89-
},
90-
'upload windows binaries': {
91-
container('jnlp') {
92-
stage('upload windows binaries') {
93-
github.upload_asset(git_project, git_project_user, "v3ctl-${github.TAG_VERSION}-windows-amd64", RELEASE_ID, GIT_TOKEN)
94-
}
95-
}
96-
}
9755
)
9856
}
9957
}

0 commit comments

Comments
 (0)