Skip to content

Commit

Permalink
release to sonatype using GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
octonato committed Apr 19, 2021
1 parent 04d982f commit 08ffec7
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 128 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
branches:
- master
tags: [ v.* ]

jobs:
release:
# runs on main repo only
if: github.repository == 'akka/akka-management'
name: Release
# the release environment provides access to secrets required in the release process
# https://github.com/akka/akka-management/settings/environments
environment: release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Setup Scala with JDK 8
uses: olafurpg/setup-scala@v10

- name: Cache Coursier cache
uses: coursier/cache-action@v5

- name: Whitesource check policies and update
env:
WHITESOURCE_PASSWORD: ${{ secrets.WHITESOURCE_PASSWORD }}
run: sbt ";whitesourceCheckPolicies ;whitesourceUpdate"

- name: Publish artifacts for all Scala versions
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: sbt ci-release

- name: Publish API and reference documentation
env:
GUSTAV_KEY: ${{ secrets.GUSTAV_KEY }}
GUSTAV_PASSPHRASE: ${{ secrets.GUSTAV_PASSPHRASE }}
run: |+
eval "$(ssh-agent -s)"
echo $GUSTAV_KEY | base64 -di > .github/id_rsa
chmod 600 .github/id_rsa
ssh-keygen -p -P "$GUSTAV_PASSPHRASE" -N "" -f .github/id_rsa
ssh-add .github/id_rsa
sbt "++2.13.4 docs/publishRsync"
35 changes: 2 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,48 +78,17 @@ jobs:
- ./lease-kubernetes-int-test/minikube-test.sh
name: "Kubernetes Lease Integration tests"


- stage: whitesource
script:
- jabba use "[email protected]"
- git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" && sbt 'set credentials += Credentials("whitesource", "whitesourcesoftware.com", "", System.getenv("WHITESOURCE_KEY"))' whitesourceCheckPolicies whitesourceUpdate
name: "Check licenses with WhiteSource"

- stage: publish
script:
- jabba use "[email protected]"
- sbt -J-XX:ReservedCodeCacheSize=128m +publish
name: Publish artifacts
- script: eval "$(ssh-agent -s)" && cp .travis/id_rsa /tmp/id_rsa && chmod 600 /tmp/id_rsa && ssh-keygen -p -P "$DEPLOY_PASSPHRASE" -N "" -f /tmp/id_rsa && ssh-add /tmp/id_rsa && sbt docs/publishRsync
name: Publish documentation

stages:
- name: check
if: NOT tag =~ ^v
- name: test
if: NOT tag =~ ^v
- name: integration
if: NOT tag =~ ^v
- name: whitesource
if: repo = akka/akka-management AND ( ( branch = master AND type = push ) OR tag =~ ^v )
- name: publish
if: repo = akka/akka-management AND ( ( branch = master AND type = push ) OR tag =~ ^v )


notifications:
email:
recipients:
secure: "Jqrw+zGxVFNxdPioir+dYW5vur2DfnVmSnQnmgf93yjkYFUoyLjqEW0CPPK3srv5AgVZL8KMrCVDTm3890e1LvEcPudZS6eiPrS58cvmfoxHkqNZd2c3PUFH+zlBVsdW2nlue8NHmLIS2R1oZuy9+i/a00qqbvn4sUylDiFQLAXOctIB7lUdXl/pmXiAxS9W3wWRbQqA7V6PrOy38HEWSB1OdzVZ/+rompBTjff1LzMt67bZKIeAJj+T942tO9MOgbLJUq+HcLg6Pvk8Swm8FPXcmHkEl9tULaOKHOnSJyU+XDYy5hBc+ymOh1xH0iXCki73b/a4Av5zVzFX2XFDAIRgzlJdfWO/QMg4G9joJcn12ozyBzR13mlontDV3hR8zJaRqy6buwW3v2DgX7873NwrjkwCR8Zy5unIE3UIvnUU5wISN+RpMHF8T/Oqu4mEYGOSPxqgxIOOZvnEKbyckYT2BSl4cZdWtiUdgWPsvAwJmBIZeuBu5OailqbySO0R5P0AeXgD7ae9LOFNxXuhuLsC/F7+KfboYcmQgpJrrHvU8ySpFq0i8lxDY9ahc5sGQ3IJidMNrK76VSKt2yTJb0my4KzEaxAfFcRuxRS4JQ+J53b5GZXaQw+a8+ThI6D8Lb3kPILQcSrP8dAbnkaggrnn20KxlPx1hC1YHf9Gz6g="
on_success: never
on_failure: always

env:
global:
# encrypt with: travis encrypt WHITESOURCE_KEY=... --com
- secure: "NrD8KdUpiq8wzxEH4EfiaxxBUHzBLmK8e7bD977gcUsvU2g+uUEaK8AiZiIBXf1cWfQCdqXfRom3ncj9h8DcaoLHjCQSdxTBtVmwxupL5KXS6rAOY61WrPbe2Cg6WW5J11aYT6pT+jXx58LjvRZsB4Tryl1UitnltMJWK/P+oipGbBdd9oR3GA5rLopCjuwozyjurlizwDCUbCOTaxc6w5Mv1S1b2+JnGjfApiex8ebhEnQlePBaDkOqHrnH9A58EhVYNclJNRkvu7mpBI6KcWJsBozHloSD20RWXiEF50bwuslBQLFBdsolo7jnYxQXRapgRKIukyFs1uhFr67t4pyHWXmbF5GrRa3jFCeAHLpH+Gcf2X43PN+K3kJm/FZQ1oNMKC/dHlhE2C9wwwMCSVorbJfuD6oTI/tee4ksCyZ9WWV+44ZFV1aIV5Dpx7hzeaQGkvDtQJK6tJEN5Tt4yP1rB9x4FC2KDugWaBUbnrFkGwiN9p7zXn/fhRRAsaDrZMeADNGMZ5tEPO+1kgOvvnBwpEwCT8si8k7SckOT1KnT2UnnA5xVzr9e1oUM6dBUECPfbsaTxjN2v9Y4TsyCt+qNsCiAvdKrDlRQEfcrbM6lm9mMSbaFSBfcThxrIRKAAh2oMc/jD0h15uWHzMO2+D6um4FtM0/WhXh//0dosJ0="
# encrypt with: travis encrypt BINTRAY_USER=... --com
- secure: "WfaoarV06fbA1e4/EtmsfEDWQk6OJ83lGwG8Q9gn5rDMSJL4qeqtyenI5B6DcFvLdamO2Otep90Dw8Ow9iF7rbycZJovvZjuZAESUZMV4Okjp+KMOlo3KmFCRhx+Fc3Ycy4IcvpcUS4xC/OzDXKjxhWEMaVhqixfj4NNR+A5HGpQocfna2ZmPJ0zEVdhx++/uhs5kf7LghmKeDwu9IeBnJgz6/ZFy3A7g2RHmkYK+V/jH45fxMY9BnbKfT4iKtfIQU2Mt8DlR+ucCwFWltPYr8ebdOPLtPcCmIigKMa1u/FKCvZknzIGpkivYi+6Jhyoqp80twdacn65fT71B6xKyabRsDEfHWHR0EXugodP/pRF0TtXDSFrI76T3iOYHI32LkzKfWv/TV7ZCLfrmN16Rrk+GGsS/KMbOZ915nJaEyc08IX3nrH/sI/etmFpPniHC/tVnyrPGBUkX9pOr7WQhWFzDQ63Z+BB8R+JnJa0g/vUcCE6gdnbh/0+lz4wTCamlBUDIwm30sMdozX3WSgIt4yRcQYyhcntxfqSkjYjrypLX7GQW//1ZJENPNTgwvKrXcuFoBtBnN2vqn4HlFoCZEsFzOVIdaJgv2boyKCC4jKCCYoP4L+w882X9nDHRotT8npov3/YBeLQSV2i67wcO245KJYgb8lP8qSXUhGxQns="
# encrypt with: travis encrypt BINTRAY_PASS=... --com
## BINTRAY_PASS must be set to the <api_key> not the <password>
- secure: "dqU4LsksI3HEDPAkqcthUPYFfJWO9y61jttyWL0XQJWZ9ZxNgzk3lgZ/tde6u1iYTeyhgbEf21/y809kdMLF3AaDeN4/1qH3gk62+kchQTo/BO2xRjDajWJiYSuTo0L5UCE1W9iKP18hhLoba95Wl0vsozq7rv7CyxYQ6poN7A44JjXeufrLzcLjS9zzgBXL5f+2Ot5Z/zda092Sb8i0KYZpaF6y0gq57unm5KgZZgvPIHR54qpattCEsWxEsfBqdYkYwXi1iVSnH7Zla6SolbmGW0cJqiVnUSZ65mEBMVQ+GVnS2xQsTZs1/vwXLV/pMJBOsdtdxPVRMQtn93ocC7UGTMJ650i7S3Z6vBvvE57fwJpn41+j0DvU9hM2XuFRtjPORdrNi7Wmss/RFvYtML+O0J8DvN65ywg1WgAKPSeceAMX3Jo5iD28aaORBoUhK8UHf6uqPl3epm+B5la3D4BTH2PwDmeH1BbXGsqh/4AyLerpHy2pZx+/c2/XESadX7xqkx4VqCyBVYX9Gvg96JrBDgvM9oWgfDkosi3QY1TO4Mfgze4W8Ow+w6z7XHx0iD/F06B2eui23tmFiGIbOcEijWyn4tSdQ94AjlCdKyIoePW067+6enlZGZeC2hswiF0BxYJXBw5iA3w1WdSPhtcUJKEGB9TKlavLWDb1+BI="
# encrypt with: travis encrypt DEPLOY_PASSPHRASE=... --com
- secure: "he7Rn+wqoIR3Tk+BLIRn3FHyoil6Ebgp/6jbxlz9RbK/nuvODN0m0X0O1zd2Xgc4HpOjeYlhp3pQuaFUlW1/mIIcectDrhWAO+YABFh+GhrP6hiW+e/M6aB8l4biU7dKCVIsXQ25r03ODbbJHwXonN8QveqHdTnnYwmyIGY6zuwcjaNcuu96hS3JAwWb+rJyzCq30ozgDcsO9EsEqiFIfgisTxB74JzNhnRQJbnWMR37qaJ1ygLZAAuVzqi1JrkzZNnn/Ob331GTQfko2ZzAte2DdNg6hdBOjeFmu2lSWa4u8ntf/0z2dua/VFI+S091JhxbPHsyXBks5whnGRWmLlq6vRjHZbkFlVea4zR3Q5pBjG3haqB1FxFCKsjjEW7vqUoVIzqkOSDfZOEvKv0N4I3GEkTJ9AMaufiXiS9i1Yr6l+hP9/sdhyJ6cQQhRsW/DumFDT5gDg9YjwE/rdklFFj3B6T4n2mrKsTxLZGpz/w5ikiE7eDGCIJJhuh8fVzsVS3H3hPk7qRo0SBvXvQugp9j80qowxIJfISjXDx9XrvNuIQioSFmBjo/RFQjevOgoZqM5iVm9FJnNrgtEOC4AtQkImxBIx7tmktukpO8nl7ouRjzb9yTeNgmLLOnV6nNxi1EV7FXWEFN43Q2Kmrrs3qXEFCLHP+pUvOe4rYuUoo="
on_failure: always
94 changes: 0 additions & 94 deletions .travis/id_rsa

This file was deleted.

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.6")
addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.18")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")
Expand Down

0 comments on commit 08ffec7

Please sign in to comment.