Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create workflow to publish #57

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This is a basic workflow that is manually triggered

name: Build and Publish

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version:
# Friendly description to be shown in the UI instead of 'name'
description: 'Version'
# Default value if no value is explicitly provided
default: 'RORY-SNAPSHOT'
# Input has to be provided for the workflow to run
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
runs-on: ubuntu-20.04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you use ubuntu-20.04 over ubuntu-latest?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably copied it from somewhere, I'll fix it. Thanks!

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'zulu'
cache: 'gradle'

- name: Publish to MavenChewtral
run: "./gradlew build publish"
env:
ORG_GRADLE_PROJECT_mchew_username: "${{ secrets.M2_USERNAME }}"
ORG_GRADLE_PROJECT_mchew_password: "${{ secrets.M2_PASSWORD }}"
BUILD_NUMBER: "${{ github.event.inputs.version }}"
javadocs:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'zulu'
cache: 'gradle'

- name: Build
run: ./gradlew javadoc

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/javadoc
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
destination_dir: ${{ github.event.inputs.version }}"