Merge pull request #27 from trocco-io/feature/fix-gem-push-setup #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- 'master' | |
types: [opened, synchronize] | |
pull_request_target: | |
branches: | |
- 'master' | |
types: [labeled] | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
if: > | |
${{ | |
github.event_name == 'pull_request' || | |
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')) || | |
startsWith(github.ref, 'refs/tags/') | |
}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: lint | |
run: ./gradlew spotlessCheck | |
- name: Test | |
run: ./gradlew test | |
build: | |
name: Build + Publish | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
needs: [ test ] | |
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'refs/tags/') }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: push gem | |
uses: trocco-io/push-gem-to-gpr-action@v1 | |
with: | |
language: java | |
gem-path: "./build/gems/*.gem" | |
github-token: "${{ secrets.GITHUB_TOKEN }}" |