2020-03-11 17:58:56 +02:00
|
|
|
name: Publish master branch binary
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-09-17 08:44:42 +02:00
|
|
|
go-version: '1.15.x'
|
2020-03-11 17:58:56 +02:00
|
|
|
- env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
run: |
|
2020-06-02 12:32:29 +02:00
|
|
|
# See https://golang.org/cmd/link/ for info on -w (omit the DWARF symbol table) and -s (omit the symbol table and debug information)
|
|
|
|
# We use those flags to get a smaller compiled binary for faster downloads.
|
|
|
|
go build -ldflags "-w -s -X github.com/SAP/jenkins-library/cmd.GitCommit=${GITHUB_SHA} \
|
2020-03-11 17:58:56 +02:00
|
|
|
-X github.com/SAP/jenkins-library/pkg/log.LibraryRepository=${GITHUB_REPOSITORY} \
|
2020-04-23 14:33:06 +02:00
|
|
|
-X github.com/SAP/jenkins-library/pkg/telemetry.LibraryRepository=https://github.com/${GITHUB_REPOSITORY}.git" \
|
2020-03-11 17:58:56 +02:00
|
|
|
-o piper_master .
|
2020-06-02 12:32:29 +02:00
|
|
|
stat --printf="File size of piper_master in bytes: %s\n" piper_master
|
2020-03-11 17:58:56 +02:00
|
|
|
- uses: SAP/project-piper-action@master
|
|
|
|
with:
|
2020-05-22 17:18:40 +02:00
|
|
|
piper-version: master
|
2020-03-11 17:58:56 +02:00
|
|
|
command: githubPublishRelease
|
|
|
|
flags: --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./piper_master
|
2021-06-10 12:39:23 +02:00
|
|
|
- env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: amd64
|
|
|
|
run: |
|
|
|
|
# See https://golang.org/cmd/link/ for info on -w (omit the DWARF symbol table) and -s (omit the symbol table and debug information)
|
|
|
|
# We use those flags to get a smaller compiled binary for faster downloads.
|
|
|
|
go build -ldflags "-w -s -X github.com/SAP/jenkins-library/cmd.GitCommit=${GITHUB_SHA} \
|
|
|
|
-X github.com/SAP/jenkins-library/pkg/log.LibraryRepository=${GITHUB_REPOSITORY} \
|
|
|
|
-X github.com/SAP/jenkins-library/pkg/telemetry.LibraryRepository=https://github.com/${GITHUB_REPOSITORY}.git" \
|
|
|
|
-o piper_master-darwin.x86_64 .
|
|
|
|
- uses: SAP/project-piper-action@master
|
|
|
|
with:
|
|
|
|
piper-version: master
|
|
|
|
command: githubPublishRelease
|
|
|
|
flags: --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./piper_master-darwin.x86_64
|
|
|
|
- env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: windows
|
|
|
|
GOARCH: amd64
|
|
|
|
run: |
|
|
|
|
# See https://golang.org/cmd/link/ for info on -w (omit the DWARF symbol table) and -s (omit the symbol table and debug information)
|
|
|
|
# We use those flags to get a smaller compiled binary for faster downloads.
|
|
|
|
go build -ldflags "-w -s -X github.com/SAP/jenkins-library/cmd.GitCommit=${GITHUB_SHA} \
|
|
|
|
-X github.com/SAP/jenkins-library/pkg/log.LibraryRepository=${GITHUB_REPOSITORY} \
|
|
|
|
-X github.com/SAP/jenkins-library/pkg/telemetry.LibraryRepository=https://github.com/${GITHUB_REPOSITORY}.git" \
|
|
|
|
-o piper_master-win.x86_64.exe .
|
|
|
|
- uses: SAP/project-piper-action@master
|
|
|
|
with:
|
|
|
|
piper-version: master
|
|
|
|
command: githubPublishRelease
|
|
|
|
flags: --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./piper_master-win.x86_64.exe
|