Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release to sonatype using GH Actions #889

Merged
merged 17 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Basic checks

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

jobs:
check-code-style:
name: Check Code Style
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: Set up JDK 11
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

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

- name: Code style check, compilation and binary-compatibility check
run: sbt "scalafmtCheckAll;headerCheckAll;+IntegrationTest/compile;mimaReportBinaryIssues"

check-docs:
name: Check Docs
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
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: Set up JDK 11
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

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

- name: Create all API docs for artifacts/website and all reference docs
run: sbt "unidoc; docs/paradox"
46 changes: 46 additions & 0 deletions .github/workflows/integration-tests-kube-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Integration test for Kubernetes API

on:
pull_request:
push:
branches:
- master
- release-*
tags-ignore: [ v.* ]
schedule:
- cron: '0 2 * * *' # every day 2am

jobs:
integration-test:
name: Integration Tests for Kubernetes API
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
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: Set up JDK [email protected]
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

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

- name: Start docker
run: |-
./scripts/setup-minikube-for-linux.sh
./integration-test/kubernetes-api/test.sh

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
46 changes: 46 additions & 0 deletions .github/workflows/integration-tests-kube-dns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Integration test for Kubernetes DNS

on:
pull_request:
push:
branches:
- master
- release-*
tags-ignore: [ v.* ]
schedule:
- cron: '0 2 * * *' # every day 2am

jobs:
integration-test:
name: Integration Tests for Kubernetes DNS
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
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: Set up JDK [email protected]
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

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

- name: Start docker
run: |-
./scripts/setup-minikube-for-linux.sh
./integration-test/kubernetes-dns/test.sh

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
56 changes: 56 additions & 0 deletions .github/workflows/integration-tests-lease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Integration test for Kubernetes Lease

on:
pull_request:
push:
branches:
- master
- release-*
tags-ignore: [ v.* ]
schedule:
- cron: '0 2 * * *' # every day 2am

jobs:
integration-test:
name: Integration test for Kubernetes Lease
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
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: Set up JDK [email protected]
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

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

- name: Start docker
timeout-minutes: 15
run: |-
echo 'Starting minikube'
./scripts/setup-minikube-for-linux.sh
echo 'Creating namespace'
kubectl create namespace lease
echo 'Creating resources'
kubectl apply -f ./lease-kubernetes/lease.yml
echo 'Adding proxy port'
kubectl proxy --port=8080 &
echo 'Running tests'
sbt ";lease-kubernetes/it:test"
./lease-kubernetes-int-test/minikube-test.sh

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
47 changes: 47 additions & 0 deletions .github/workflows/integration-tests-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Integration test for Kubernetes API with Maven

on:
pull_request:
push:
branches:
- master
- release-*
tags-ignore: [ v.* ]
# Different than its sibilings, we don't configure this workflow to run as a cron job.
# The cron build compiles against Akka 2.6 and Akka HTTP 10.2, but the Maven example uses 2.5 and 10.1
# see https://github.com/akka/akka-management/issues/744

jobs:
integration-test:
name: Integration Tests for Kubernetes API with Maven
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
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: Set up JDK [email protected]
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

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

- name: Start docker
run: |-
./scripts/setup-minikube-for-linux.sh
./integration-test/kubernetes-api-java/test.sh

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- master
- release-*

jobs:
update_release_draft:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
branches:
- master
- release-*
tags: ["*"]

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

55 changes: 55 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Unit Tests

on:
pull_request:
push:
branches:
- master
- release-*
tags-ignore: [ v.* ]
schedule:
- cron: '0 2 * * *' # every day 2am

jobs:
test:
name: Build and Test
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
include:
- { java-version: [email protected], scala-version: 2.12.13, sbt-opts: '' }
- { java-version: [email protected], scala-version: 2.12.13, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { java-version: [email protected], scala-version: 2.13.5, sbt-opts: '' }
- { java-version: [email protected], scala-version: 2.13.5, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
steps:
- name: Checkout
uses: actions/checkout@v2
with:
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 JDK ${{ matrix.java-version }}
uses: olafurpg/setup-scala@v10
with:
java-version: ${{ matrix.java-version }}

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

# hack to solve "Cannot assign requested address" issue - https://github.community/t/github-action-and-oserror-errno-99-cannot-assign-requested-address/173973/1
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts

- name: Run tests with Scala ${{ matrix.scala-version }} and Java ${{ matrix.java-version }}
run: sbt "++${{ matrix.scala-version }} test" ${{ matrix.sbt-opts }}

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
Loading