updated workflows #9
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
# This is a basic workflow to help you get started with Actions | |
name: CI 1.19 | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ 1.19 ] | |
pull_request: | |
branches: [ 1.19 ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: checkout repository | |
uses: actions/checkout@v2 | |
- name: validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: setup jdk 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: make gradle wrapper executable | |
run: chmod +x ./gradlew | |
- name: Get ChangeLog | |
id: changelog | |
run: | | |
MY_STRING=$(sed '/===/Q' changelog.txt) | |
MY_STRING="${MY_STRING//'%'/'%25'}" | |
MY_STRING="${MY_STRING//$'\n'/'%0A'}" | |
MY_STRING="${MY_STRING//$'\r'/'%0D'}" | |
echo "::set-output name=log::$MY_STRING" | |
- name: buildwith Gradle | |
run: ./gradlew build | |
- uses: actions/github-script@v2 | |
id: fname | |
with: | |
result-encoding: string | |
script: | | |
const fs = require("fs") | |
return fs.readdirSync("./build/libs/").filter(e => !e.endsWith("dev.jar") && !e.endsWith("sources.jar") && e.endsWith(".jar"))[0].replace(".jar", ""); | |
- name: Upload to curseforge | |
uses: itsmeow/curseforge-upload@v2 | |
with: | |
token: ${{ secrets.CFUPLOADKEY }} | |
project_id: 509557 | |
game_endpoint: minecraft | |
file_path: ./build/libs/${{ steps.fname.outputs.result }}.jar | |
changelog: ${{ steps.changelog.outputs.log }} | |
display_name: ${{ steps.fname.outputs.result }} | |
game_versions: 73407:1.19.3,73407:1.19,2:Java 17,68441:Forge | |
release_type: alpha | |
- name: upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Artifacts | |
path: build/libs/ | |