You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
Release go-binary via piper action (#1243)
This commit is contained in:
27
.github/workflows/release-go-master.yml
vendored
Normal file
27
.github/workflows/release-go-master.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
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:
|
||||
go-version: '1.13.x'
|
||||
- env:
|
||||
CGO_ENABLED: 0
|
||||
run: |
|
||||
go build -ldflags "-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=${GITHUB_REPOSITORY}" \
|
||||
-o piper_master .
|
||||
- uses: SAP/project-piper-action@master
|
||||
with:
|
||||
piper-version: latest
|
||||
command: githubPublishRelease
|
||||
flags: --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./piper_master
|
27
.github/workflows/release-go.yml
vendored
Normal file
27
.github/workflows/release-go.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Create new Release
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * 1'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Prepare Release
|
||||
run: |
|
||||
curl --insecure --silent --location --write-out '%{http_code}' --output ./piper_master https://github.com/SAP/jenkins-library/releases/latest/download/piper_master
|
||||
cp ./piper_master ./piper
|
||||
npm install semver --quiet
|
||||
echo "::set-env name=PIPER_version::v$(node_modules/.bin/semver -i minor $(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r .tag_name))"
|
||||
- uses: SAP/project-piper-action@master
|
||||
with:
|
||||
piper-version: latest
|
||||
command: githubPublishRelease
|
||||
flags: --token ${{ secrets.GITHUB_TOKEN }} --assetPath ./piper_master
|
||||
- uses: SAP/project-piper-action@master
|
||||
with:
|
||||
piper-version: latest
|
||||
command: githubPublishRelease
|
||||
flags: --token ${{ secrets.GITHUB_TOKEN }} --version latest --assetPath ./piper
|
12
.travis.yml
12
.travis.yml
@@ -22,17 +22,7 @@ cache:
|
||||
jobs:
|
||||
include:
|
||||
- stage: Tests
|
||||
name: Golang Build & Publish
|
||||
if: type != pull_request && repo = "SAP/jenkins-library" && branch = "master"
|
||||
script:
|
||||
- docker build -t piper:${TRAVIS_BRANCH} .
|
||||
- docker create --name piper_${TRAVIS_BRANCH} piper:${TRAVIS_BRANCH}
|
||||
- docker cp piper_${TRAVIS_BRANCH}:/build/piper .
|
||||
- docker rm piper_${TRAVIS_BRANCH}
|
||||
- cp ./piper ./piper_master
|
||||
- chmod +x ./piper
|
||||
- ./piper githubPublishRelease --token ${GITHUB_TOKEN} --version latest --assetPath ./piper_master
|
||||
- name: Consumer Tests
|
||||
name: Consumer Tests
|
||||
if: repo = "SAP/jenkins-library" && ( (type != pull_request && branch =~ /^master$|^it\/.*$/) || (type == pull_request && head_repo = "SAP/jenkins-library" && head_branch =~ /^it\/.*$/) )
|
||||
script: cd consumer-test && groovy consumerTestController.groovy
|
||||
- stage: Docs
|
||||
|
Reference in New Issue
Block a user