Skip to content

Commit

Permalink
ci: add devbuild and release-build (copy-pasted from fs...)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadron67 committed Jun 24, 2021
1 parent 0a48848 commit d60b4e8
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/devbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Development Builds

on: [push, workflow_dispatch]

jobs:
Build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 16
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- uses: actions/upload-artifact@v2
with:
name: Compiled artifacts for ${{ github.sha }}
path: build/libs
47 changes: 47 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Thanks to https://github.com/gnembon/fabric-carpet/blob/master/.github/workflows/publish-release.yml
# which is much more complicated..

name: Release Builds

on:
push:
tags:
- 'v*'

jobs:
Build-And-Publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 16
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- uses: actions/upload-artifact@v2
with:
name: Compiled artifacts for ${{ github.sha }}
path: build/libs
- name: Find correct JAR
id: findjar
run: |
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
echo "::set-output name=jarname::$output"
- name: Create Github release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/libs/${{ steps.findjar.outputs.jarname }}

0 comments on commit d60b4e8

Please sign in to comment.