Skip to content

Commit

Permalink
Update to Ferry v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Prospector committed Jan 24, 2021
1 parent 6ba3046 commit b8e7b58
Show file tree
Hide file tree
Showing 11 changed files with 549 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on: [pull_request, push]
name: Check Build
on: [push, pull_request]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
1.8, # Minimum supported by Minecraft
11, # Current Java LTS
15 # Latest version
1.8, # Minimum
11, # LTS
15 # Latest
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-latest]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
Expand All @@ -32,7 +33,7 @@ jobs:
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
run: ./gradlew build --stacktrace --parallel
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/release_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Next Beta
on: [workflow_dispatch] # Manual trigger
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [11]
# and run on both Linux and Windows
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previous-tag
uses: WyriHaximus/[email protected]
- name: Get SemVer increments
id: semver
uses: WyriHaximus/[email protected]
with:
version: ${{ steps.previous-tag.outputs.tag }}
- name: Create version tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
let oldTag = "${{ steps.previous-tag.outputs.tag }}"
let regex = /[v]?([0-9]+\.[0-9]+\.[0-9]+)+-beta.([0-9]+)[+]?.*/
if (regex.test(oldTag)) {
let match = oldTag.match(regex)
let betaIncrement = parseInt(match[2], 10) + 1
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v" + match[1] + "-beta." + betaIncrement,
sha: context.sha
})
}
- name: Fetch tags
run: git fetch --tags
- name: Get current tag
id: current-tag
uses: WyriHaximus/[email protected]
- 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 generateChangelog build publish curseforge github publishModrinth --stacktrace --parallel -PlastTag="${{ steps.previous-tag.outputs.tag }}" -PcurrentTag="${{ steps.current-tag.outputs.tag }}"
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
65 changes: 65 additions & 0 deletions .github/workflows/release_major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release Major
on: [workflow_dispatch] # Manual trigger
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [11]
# and run on both Linux and Windows
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previous-tag
uses: WyriHaximus/[email protected]
- name: Get SemVer increments
id: semver
uses: WyriHaximus/[email protected]
with:
version: ${{ steps.previous-tag.outputs.tag }}
- name: Create version tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.semver.outputs.major }}",
sha: context.sha
})
- name: Fetch tags
run: git fetch --tags
- name: Get current tag
id: current-tag
uses: WyriHaximus/[email protected]
- 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 generateChangelog build publish curseforge github publishModrinth --stacktrace --parallel -PlastTag="${{ steps.previous-tag.outputs.tag }}" -PcurrentTag="${{ steps.current-tag.outputs.tag }}"
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
65 changes: 65 additions & 0 deletions .github/workflows/release_major_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Beta Major
on: [workflow_dispatch] # Manual trigger
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [11]
# and run on both Linux and Windows
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previous-tag
uses: WyriHaximus/[email protected]
- name: Get SemVer increments
id: semver
uses: WyriHaximus/[email protected]
with:
version: ${{ steps.previous-tag.outputs.tag }}
- name: Create version tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.semver.outputs.major }}-beta.1",
sha: context.sha
})
- name: Fetch tags
run: git fetch --tags
- name: Get current tag
id: current-tag
uses: WyriHaximus/[email protected]
- 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 generateChangelog build publish curseforge github publishModrinth --stacktrace --parallel -PlastTag="${{ steps.previous-tag.outputs.tag }}" -PcurrentTag="${{ steps.current-tag.outputs.tag }}"
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
65 changes: 65 additions & 0 deletions .github/workflows/release_minor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release Minor
on: [workflow_dispatch] # Manual trigger
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [11]
# and run on both Linux and Windows
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previous-tag
uses: WyriHaximus/[email protected]
- name: Get SemVer increments
id: semver
uses: WyriHaximus/[email protected]
with:
version: ${{ steps.previous-tag.outputs.tag }}
- name: Create version tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.semver.outputs.minor }}",
sha: context.sha
})
- name: Fetch tags
run: git fetch --tags
- name: Get current tag
id: current-tag
uses: WyriHaximus/[email protected]
- 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 generateChangelog build publish curseforge github publishModrinth --stacktrace --parallel -PlastTag="${{ steps.previous-tag.outputs.tag }}" -PcurrentTag="${{ steps.current-tag.outputs.tag }}"
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
65 changes: 65 additions & 0 deletions .github/workflows/release_minor_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Beta Minor
on: [workflow_dispatch] # Manual trigger
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [11]
# and run on both Linux and Windows
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previous-tag
uses: WyriHaximus/[email protected]
- name: Get SemVer increments
id: semver
uses: WyriHaximus/[email protected]
with:
version: ${{ steps.previous-tag.outputs.tag }}
- name: Create version tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.semver.outputs.minor }}-beta.1",
sha: context.sha
})
- name: Fetch tags
run: git fetch --tags
- name: Get current tag
id: current-tag
uses: WyriHaximus/[email protected]
- 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 generateChangelog build publish curseforge github publishModrinth --stacktrace --parallel -PlastTag="${{ steps.previous-tag.outputs.tag }}" -PcurrentTag="${{ steps.current-tag.outputs.tag }}"
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
Loading

0 comments on commit b8e7b58

Please sign in to comment.