Skip to content

better vanish

better vanish #11

Workflow file for this run

name: build
on: [pull_request, push]
jobs:
build:
strategy:
matrix:
java: [
17,
]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: Get mod_version value
run: |
echo "MOD_VERSION=$(grep ^mod_version= gradle.properties | cut -d '=' -f2)" >> $GITHUB_ENV
- name: upload main jar
uses: actions/upload-artifact@v2
with:
name: bta_utils-${{ env.MOD_VERSION }}.jar
path: build/libs/bta_utils-${{ env.MOD_VERSION }}.jar
- name: upload sources jar
uses: actions/upload-artifact@v2
with:
name: bta_utils-${{ env.MOD_VERSION }}-sources.jar
path: build/libs/bta_utils-${{ env.MOD_VERSION }}-sources.jar
- name: create GitHub release
if: startsWith(github.ref, 'refs/tags/v') # Create a release only for tags starting with 'v'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: upload release assets
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: bta_utils-${{ matrix.os }}.jar
asset_path: build/libs/bta_utils.jar
asset_content_type: application/octet-stream
- name: upload release source assets
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: bta_utils-${{ matrix.os }}-sources.jar
asset_path: build/libs/bta_utils-sources.jar
asset_content_type: application/octet-stream