Skip to content

Commit

Permalink
Merge pull request #393 from Team-EnderIO/feature/nightly-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rover656 authored Jul 30, 2023
2 parents 09f0f7b + 1161ac0 commit 9bdfe16
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 218 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Nightly Build
env:
CI: true
BUILD_NUMBER: ${{ github.run_number }}
NIGHTLY: true

# Run on all develop pushes
on:
push:
branches:
- 'dev/*'

# Cancel if a new push is sent
# https://stackoverflow.com/a/70972844
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build

- uses: actions/upload-artifact@v3
with:
name: nightly-build
path: build/libs/*.jar

- name: Discord Notification
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.NIGHTLY_DISCORD_WEBHOOK }}
embed-title: New Nightly Build
embed-description: A new nightly build of Ender IO has been built from the following commit. If you play with this, please remember to report issues! ```${{ github.event.head_commit.message }}```
avatar-url: https://raw.githubusercontent.com/Team-EnderIO/EnderIO/dev/1.20.1/doc/img/enderface.png
username: Ender IO Nightowl
embed-footer-text: Build number ${{ github.run_number }}
embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Release Build
env:
CI: true
BUILD_VERSION: ${{ github.event.release.tag_name }}
CHANGELOG: ${{ github.event.release.body }}
PUBLISH: true

# Run when release is created on GitHub
on:
release:
types: [ published ]

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Clean
uses: gradle/gradle-build-action@v2
with:
arguments: clean

- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build

- uses: actions/upload-artifact@v3
with:
name: release-build
path: build/libs/*.jar

- name: Publish to CurseForge and Modrinth
uses: gradle/gradle-build-action@v2
env:
CURSEFORGE_TOKEN: ${{ secrets.TOKEN_CURSEFORGE }}
MODRINTH_TOKEN: ${{ secrets.TOKEN_MODRINTH }}
with:
arguments: publishMod

# TODO: Publish to maven.

- name: Upload to GitHub Releases
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.TOKEN_GITHUB }}
files: build/libs/*.jar

- name: Truncate Build Notes
uses: 2428392/[email protected]
id: truncatedChangelog
with:
stringToTruncate: ${{ github.event.release.body }}
maxLength: 1000

- name: Discord Notification
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.RELEASE_DISCORD_WEBHOOK }}
embed-title: Ender IO ${{ github.event.release.tag_name }} Released
embed-description: ${{ steps.truncatedChangelog.outputs.string }}
avatar-url: https://raw.githubusercontent.com/Team-EnderIO/EnderIO/dev/1.20.1/doc/img/enderface.png
username: Ender IO Releases
embed-footer-text: ${{ github.event.release.tag_name }}
embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
3 changes: 0 additions & 3 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ name: Verify Build and Generated Data
# If run on the primary branch, the gradle caches will be updated for all PRs to use.
on:
pull_request:
push:
branches:
- 'dev/*'

jobs:
verify:
Expand Down
128 changes: 0 additions & 128 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 9bdfe16

Please sign in to comment.