Skip to content

Commit

Permalink
Release SNAPSHOT versions (scalar-labs#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
brfrn169 authored Apr 22, 2022
1 parent dde6741 commit 3be2f62
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 7 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release SHAPSHOT

on:
push:
branches:
- master
- "[0-9]+"
- "[0-9]+.[0-9]+"

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set version
id: version
run: |
VERSION=$(gradle :core:properties -q | grep "version:" | awk '{print $2}')
echo ::set-output name=version::${VERSION}
- name: Upload SNAPSHOT versions for scalardb, scalardb-server, scalardb-rpc, and scalardb-schema-loader to Maven Central Repository
if: contains(steps.version.outputs.version, '-SNAPSHOT')
run: |
echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg
gradle publish \
-Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \
-P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \
-Psigning.secretKeyRingFile="$(echo ~/.gradle/secring.gpg)" \
-PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \
-PossrhPassword="${{ secrets.OSSRH_PASSWORD }}"
7 changes: 0 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,3 @@ jobs:
asset_path: schema-loader/build/libs/scalardb-schema-loader-${{ steps.version.outputs.version }}.jar
asset_name: scalardb-schema-loader-${{ steps.version.outputs.version }}.jar
asset_content_type: application/java-archive

- name: Cleanup Gradle cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties

0 comments on commit 3be2f62

Please sign in to comment.