Skip to content
Snippets Groups Projects
Commit b2d98f49 authored by Griefed's avatar Griefed :joystick:
Browse files

ci: GitHub workflows for documentation, release mirroring from GitLab upon tag...

ci: GitHub workflows for documentation, release mirroring from GitLab upon tag push, greetings and sponsor labels for issues
parent 3ec18fb4
No related branches found
No related tags found
No related merge requests found
name: Deploy javadocs to GitHub pages
on:
push:
branches:
- main
workflow_dispatch:
jobs:
pages:
runs-on: ubuntu-latest
steps:
# GET LATEST CODE
- name: Checkout latest code
uses: actions/checkout@master
with:
fetch-depth: 0
# BUILD PROJECT AND PUBLISH TO PACKAGES
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build documentation
run: ./gradlew about build -x test
- name: List files
run: ls -ahl build/libs
# DEPLOY TO GH-PAGES
- name: Deploy to GitHub-Pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: build/docs/javadoc
name: Create GitHub Release after GitLab tag mirror
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
# GET LATEST CODE
- name: Checkout latest code
uses: actions/checkout@master
with:
fetch-depth: 0
# EXTRACT TAG FROM PUSH
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Use tag
run: echo ${{steps.tag.outputs.tag}}
# GENERATE CHANGELOG, RELEASE
- id: conventional_changelog
uses: ardalanamini/auto-changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{steps.tag.outputs.tag}}
body: |
Automatic release of version: **${{steps.tag.outputs.tag}}**
**Changes in this release:**
${{ steps.conventional_changelog.outputs.changelog }}
draft: false
prerelease: false
# BUILD PROJECT AND PUBLISH TO PACKAGES
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish to GitHub Packages
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NEW_VERSION=$(echo "${{steps.tag.outputs.tag}}")
echo "New version: ${NEW_VERSION}"
echo "Github username: ${GITHUB_ACTOR}"
./gradlew about
./gradlew -Pversion=${NEW_VERSION} --info -x test
- name: List files
run: ls -ahl build/libs
# UPLOAD ASSETS TO RELEASE
- name: Upload Release Asset Main Jar
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/libs/serverpackcreatorexampleaddon-${{steps.tag.outputs.tag}}.jar
asset_name: serverpackcreatorexampleaddon-${{steps.tag.outputs.tag}}.jar
asset_content_type: application/jar
- name: Upload Release Asset Sources Jar
id: upload-release-asset-sources
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/libs/serverpackcreatorexampleaddon-${{steps.tag.outputs.tag}}-sources.jar
asset_name: serverpackcreatorexampleaddon-${{steps.tag.outputs.tag}}-sources.jar
asset_content_type: application/jar
- name: Upload Release Asset Javadoc Jar
id: upload-release-asset-javadoc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/libs/serverpackcreatorexampleaddon-${{steps.tag.outputs.tag}}-javadoc.jar
asset_name: serverpackcreatorexampleaddon-${{steps.tag.outputs.tag}}-javadoc.jar
asset_content_type: application/jar
\ No newline at end of file
name: Greetings
on: [pull_request, issues]
jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/Griefed/ServerPackCreator/blob/1bbbfc59207e801068aa0f92ccd2869079fce7da/.github/ISSUE_TEMPLATE/bug-report.md), [feature](https://github.com/Griefed/ServerPackCreator/blob/1bbbfc59207e801068aa0f92ccd2869079fce7da/.github/ISSUE_TEMPLATE/feature-request.md), or [documentation](https://github.com/Griefed/ServerPackCreator/blob/1bbbfc59207e801068aa0f92ccd2869079fce7da/.github/ISSUE_TEMPLATE/documentation-request.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/Griefed/ServerPackCreator/blob/1bbbfc59207e801068aa0f92ccd2869079fce7da/.github/ISSUE_TEMPLATE/pull_request.md)!'
name: Label sponsors
on:
pull_request:
types: [opened]
issues:
types: [opened]
jobs:
build:
name: Label issues and pull requests made by sponsors
runs-on: ubuntu-latest
steps:
- uses: JasonEtco/is-sponsor-label-action@v1
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment