68 lines
2.4 KiB
YAML
68 lines
2.4 KiB
YAML
# This workflow will build a Java project with Gradle
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
|
|
name: Fabric CI
|
|
|
|
on:
|
|
push:
|
|
branches: fabric
|
|
pull_request:
|
|
branches: fabric
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
name: Fetching branches
|
|
with:
|
|
ref: 'fabric'
|
|
- name: Set up JDK 1.8
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 1.8
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
- name: Build with Gradle
|
|
run: ./gradlew build
|
|
- name: Execute permission for renaming script
|
|
run: chmod +x ./.github/workflows/main.sh
|
|
- name: Running main script
|
|
run: ./.github/workflows/main.sh
|
|
|
|
# Artifact upload
|
|
- name: Uploading artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
#name: ${{ env.BUILDNAME }}.jar
|
|
name: UNZIP_ME_${{ env.BUILDNAME }}
|
|
path: build/libs/${{ env.BUILDNAME }}.jar
|
|
- name: Create a Release
|
|
if: ${{ env.SHOULD_PUBLISH }}
|
|
id: create_release
|
|
uses: actions/create-release@v1.1.4
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
|
|
tag_name: ${{ env.VERSION }}
|
|
# The name of the release. For example, `Release v1.0.1`
|
|
release_name: SimpleAuth ${{ env.VERSION }}
|
|
# Text describing the contents of the tag.
|
|
body: This release was created automatically, since version was bumped. Should be stable unless I messed up something.
|
|
- name: Upload a Release Asset
|
|
if: ${{ env.SHOULD_PUBLISH }}
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
# The URL for uploading assets to the release
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
# The path to the asset you want to upload
|
|
asset_path: build/libs/${{ env.BUILDNAME }}.jar
|
|
# The name of the asset you want to upload
|
|
asset_name: ${{ env.PROJECT_ID }}_fabric-${{ env.VERSION }}-${{ env.MC_VERSION }}.jar
|
|
asset_content_type: application/zip
|