diff --git a/.github/workflows/release-go-master.yml b/.github/workflows/release-go-master.yml new file mode 100644 index 000000000..94aa75728 --- /dev/null +++ b/.github/workflows/release-go-master.yml @@ -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 diff --git a/.github/workflows/release-go.yml b/.github/workflows/release-go.yml new file mode 100644 index 000000000..b1b016790 --- /dev/null +++ b/.github/workflows/release-go.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index cb070cfbd..81f54e547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,29 +21,19 @@ cache: # Travis GHPages deploy provider: https://docs.travis-ci.com/user/deployment/pages/ 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 + - stage: 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 name: Create Documentation install: docker pull squidfunk/mkdocs-material:3.0.4 - before_script: + before_script: - documentation/bin/createDocu.sh - docker run -u `id -u`:`id -g` --rm -it -e GOCACHE=/tmp -v ${TRAVIS_BUILD_DIR}:/docu-gen golang sh -c "cd /docu-gen && go get github.com/SAP/jenkins-library/... && go run /docu-gen/pkg/generator/step-metadata.go --docuDir=/docu-gen/documentation/docs/steps/ --docuGen=true " script: - docker run -u `id -u`:`id -g` --rm -it -v ${TRAVIS_BUILD_DIR}/documentation:/docs squidfunk/mkdocs-material:3.0.4 build --clean --strict - after_script: + after_script: - mkdir -p documentation/docs-gen/misc - cp target/docuMetaData.json documentation/docs-gen/misc deploy: