Skip to content

Commit

Permalink
Merge pull request #183 from scalecube/update-parent
Browse files Browse the repository at this point in the history
Update parent
  • Loading branch information
artem-v authored Sep 21, 2020
2 parents 46791aa + 693c3ec commit 5bdb4cc
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 83 deletions.
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: Feature Branch CI
name: Branch CI

on:
push:
paths-ignore:
- '.github/workflows/**'
- 'README.md'
- '*.md'
- '*.txt'
branches-ignore:
- 'master'
- 'develop'
- 'release*'

jobs:
build:
name: Feature Branch CI
name: Branch CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
64 changes: 0 additions & 64 deletions .github/workflows/master-ci.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/pre-release-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Pre-release CI

on:
release:
types: [prereleased]

jobs:
build:
name: Pre-release CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Deploy pre-release version
run: |
pre_release_version=${{ github.event.release.tag_name }}
echo Pre-release version $pre_release_version
mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false
mvn versions:commit
mvn clean deploy -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Rollback pre-release (remove tag)
if: failure()
run: git push origin :refs/tags/${{ github.event.release.tag_name }}
44 changes: 33 additions & 11 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: Release CI

on:
release:
types: [published]
types: [released]

jobs:
build:
name: Release CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: git checkout ${{ github.event.release.target_commitish }}
- uses: actions/cache@v1
with:
path: ~/.m2/repository
Expand All @@ -23,16 +26,35 @@ jobs:
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Deploy release version
run: |
# `tag` is the concatenation of `v` and a version by the tag convention.
release_version=$(echo ${{ github.event.release.tag_name }} | sed "s/v//")
echo Release version $release_version
mvn versions:set -DnewVersion=$release_version -DgenerateBackupPoms=false
mvn versions:commit
mvn clean deploy -B -V
- name: Maven Build
run: mvn clean install -DskipTests=true -Ddockerfile.skip=true -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Rollback release (remove tag)
- name: Maven Verify
run: mvn verify -B
- name: Configure git
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
- name: Prepare release
id: prepare_release
run: |
mvn -B build-helper:parse-version release:prepare \
-DreleaseVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} \
-Darguments="-DskipTests=true -Ddockerfile.skip=true"
echo ::set-output name=release_tag::$(git describe --tags --abbrev=0)
- name: Perform release
run: mvn -B release:perform -Darguments="-DskipTests=true -Ddockerfile.skip=true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Rollback release
if: failure()
run: git push origin :refs/tags/${{ github.event.release.tag_name }}
run: |
mvn release:rollback || echo "nothing to rollback"
git push origin :refs/tags/${{ github.event.release.tag_name }}
if [ ! -z "${{ steps.prepare_release.outputs.release_tag }}" ]
then
git tag -d ${{ steps.prepare_release.outputs.release_tag }}
git push origin :refs/tags/${{ steps.prepare_release.outputs.release_tag }}
fi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class KubernetesVaultTokenSupplier implements VaultTokenSupplier {

Expand Down Expand Up @@ -44,8 +45,8 @@ public String getToken(VaultConfig config) {
Objects.requireNonNull(vaultRole, "vault role");
Objects.requireNonNull(vaultJwtProvider, "jwt provider");
Objects.requireNonNull(serviceAccountTokenPath, "k8s service account token path");
try {
String jwt = Files.lines(Paths.get(serviceAccountTokenPath)).collect(Collectors.joining());
try (Stream<String> stream = Files.lines(Paths.get(serviceAccountTokenPath))) {
String jwt = stream.collect(Collectors.joining());
return Objects.requireNonNull(
new Vault(config)
.auth()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.scalecube</groupId>
<artifactId>scalecube-parent-pom</artifactId>
<version>0.2.1</version>
<version>0.2.17</version>
</parent>

<artifactId>scalecube-config-parent</artifactId>
Expand Down

0 comments on commit 5bdb4cc

Please sign in to comment.