Yatopia/.github/workflows/build.yml
2020-07-18 11:04:49 -05:00

89 lines
2.7 KiB
YAML

name: YAPFA Build Script
on:
push:
paths-ignore:
- '*.md'
branches:
- dev/ver/1.16.1
- master
pull_request:
paths-ignore:
- '*.md'
branches:
- dev/ver/1.16.1
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 8, 14]
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2.3.1
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1.3.0
with:
java-version: ${{ matrix.java }}
- name: Pull Maven Cache
uses: actions/cache@v2
id: maven-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- uses: s4u/maven-settings-action@v2.1.0
name: Use ${{ matrix.java }} as the java target
with:
properties: '[{"maven.compiler.target": "${{ matrix.java }}"}]'
- name: Setup YAPFA Project
run: |
git submodule update --init --recursive -f
git config --global user.email "ci@github.com"
git config --global user.name "Github CI"
sudo chmod -R -f 777 scripts
- name: Build Maven Depends
if: steps.maven-cache.outputs.cache-hit != 'true'
run: |
cd Tuinity
./tuinity jar
cd ..//
- name: Build YAPFA
run: |
./yapfa full
- name: Upload Artifact
uses: actions/upload-artifact@2.1.0
with:
name: YAPFA-${{ matrix.java }}--${{ github.ref }}
path: target/YAPFA-1.16.1-paperclip.jar
- name: Create Release
id: create_release
uses: actions/create-release@v1.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: YAPFA Release 1.16.1 Java ${{ matrix.java }} ${{ github.ref }}
body: |
This an an automated release!
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/YAPFA-1.16.1-paperclip.jar
asset_name: YAPFA-${{ matrix.java }}--${{ github.ref }}