Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2167 from Netflix/publish_workflow
Browse files Browse the repository at this point in the history
Added publish workflow
  • Loading branch information
apanicker-nflx authored Apr 9, 2021
2 parents 87d7ddc + d23dc2a commit 7650431
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ categories:
- title: 'New'
label: 'type: feature'
- title: 'Bug Fixes'
labels:
- 'type: bug'
- 'type: maintenance'
label: 'type: bug'
- title: 'Refactor'
label: 'type: maintenance'
- title: 'Documentation'
label: 'type: docs'
- title: 'Dependency Updates'
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This workflow will build the project

name: CI
name: Continuous Integration Workflow

on: [ push, pull_request ]

Expand All @@ -27,6 +25,17 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
if: github.ref != 'refs/heads/main'
run: |
echo "Running build for commit ${{ github.sha }} in ${{ github.head_ref }}"
./gradlew build --stacktrace
- name: Build and Publish snapshot
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
run: |
echo "Running build for commit ${{ github.sha }}"
./gradlew build snapshot --stacktrace
env:
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to NetflixOSS and Maven Central
on:
release:
types:
- released
- prereleased

jobs:
publish:
runs-on: ubuntu-latest
name: Gradle Build and Publish
steps:
- uses: actions/checkout@v2
- name: Setup jdk 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: Publish candidate
if: |
startsWith(github.ref, 'refs/tags/v') &&
contains(github.ref, '-rc.')
run: ./gradlew --stacktrace -Prelease.useLastTag=true candidate
env:
NETFLIX_OSS_SONATYPE_USERNAME: ${{ secrets.ORG_SONATYPE_USERNAME }}
NETFLIX_OSS_SONATYPE_PASSWORD: ${{ secrets.ORG_SONATYPE_PASSWORD }}
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
- name: Publish release
if: |
startsWith(github.ref, 'refs/tags/v') &&
(!contains(github.ref, '-rc.'))
run: ./gradlew --stacktrace -Prelease.useLastTag=true final
env:
NETFLIX_OSS_SONATYPE_USERNAME: ${{ secrets.ORG_SONATYPE_USERNAME }}
NETFLIX_OSS_SONATYPE_PASSWORD: ${{ secrets.ORG_SONATYPE_PASSWORD }}
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
File renamed without changes.

0 comments on commit 7650431

Please sign in to comment.