Yatopia/.github/workflows/build.yml

89 lines
2.7 KiB
YAML
Raw Normal View History

2020-07-18 16:16:53 +02:00
name: YAPFA Build Script
2020-02-26 17:29:12 +01:00
2020-07-18 16:16:33 +02:00
on:
push:
paths-ignore:
- '*.md'
2020-07-18 16:27:44 +02:00
branches:
- dev/ver/1.16.1
- master
2020-07-18 16:16:33 +02:00
pull_request:
paths-ignore:
- '*.md'
2020-07-18 16:27:44 +02:00
branches:
- dev/ver/1.16.1
- master
2020-02-26 17:29:12 +01:00
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
2020-07-17 05:18:15 +02:00
java: [11, 8, 14]
2020-02-26 17:29:12 +01:00
steps:
2020-07-18 16:16:33 +02:00
- name: Cancel Previous Runs
2020-07-18 18:59:48 +02:00
uses: styfle/cancel-workflow-action@0.4.1
2020-07-18 16:16:33 +02:00
with:
access_token: ${{ github.token }}
2020-07-18 18:57:55 +02:00
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
2020-07-18 18:57:55 +02:00
uses: actions/setup-java@v1
2020-03-21 17:32:08 +01:00
with:
java-version: ${{ matrix.java }}
- name: Pull Maven Cache
2020-07-18 18:03:26 +02:00
uses: actions/cache@v2
id: maven-cache
2020-07-11 22:31:40 +02:00
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
2020-07-18 18:57:55 +02:00
- uses: s4u/maven-settings-action@v2
2020-07-17 17:39:18 +02:00
name: Use ${{ matrix.java }} as the java target
2020-07-17 05:18:15 +02:00
with:
2020-07-17 17:39:18 +02:00
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 ..//
2020-02-26 17:29:12 +01:00
- name: Build YAPFA
run: |
2020-07-17 04:02:27 +02:00
./yapfa full
2020-03-22 17:20:21 +01:00
- name: Upload Artifact
2020-07-18 19:03:07 +02:00
uses: actions/upload-artifact@2.1.0
2020-03-22 17:20:21 +01:00
with:
2020-07-18 19:01:59 +02:00
name: YAPFA-${{ matrix.java }} ${{ github.ref }}
2020-07-17 05:44:48 +02:00
path: target/YAPFA-1.16.1-paperclip.jar
2020-07-18 16:58:38 +02:00
- name: Create Release
id: create_release
2020-07-18 18:57:55 +02:00
uses: actions/create-release@v1
2020-07-18 16:58:38 +02:00
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 }}
2020-07-18 17:53:33 +02:00
release_name: YAPFA Release 1.16.1 Java ${{ matrix.java }} ${{ github.ref }}
2020-07-18 16:58:38 +02:00
body: |
This an an automated release!
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
2020-07-18 18:57:55 +02:00
uses: actions/upload-release-asset@v1
2020-07-18 16:58:38 +02:00
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 }}