init #1
Workflow file for this run
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: CI/CD | |
on: | |
push: | |
tags: | |
- '*' | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 | |
- name: Test | |
run: ./gradlew clean test | |
build: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Execute Gradle build | |
run: ./gradlew build | |
- name: Copy jar to workspace | |
run: cp build/libs/*.jar $GITHUB_WORKSPACE/ | |
env: | |
GITHUB_WORKSPACE: ${{ github.workspace }} | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ github.workspace }}/*.jar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Uploaded release | |
run: echo "Uploaded ${{ steps.create_release.outputs.upload_url }}" |