Skip to content

fix: Use temurin JDK in CI (#71) #43

fix: Use temurin JDK in CI (#71)

fix: Use temurin JDK in CI (#71) #43

name: Publish release
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'versions.yml'
jobs:
changelog:
name: Generate Changelog
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.changelog.outputs.tag }}
skipped: ${{ steps.changelog.outputs.skipped }}
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
changelog: ${{ steps.changelog.outputs.changelog }}
release_id: ${{ steps.release.outputs.id }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PRIVATE_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 16
- run: |
npm install [email protected]
npm install [email protected]
- name: Set up version.json
run: echo "{"version":$(git describe --tags --abbrev=0)}" > version.json
- name: Create changelog
id: changelog
uses: TriPSs/[email protected]
with:
github-token: ${{ secrets.PRIVATE_TOKEN }}
git-user-name: 'WynntilsBot'
git-user-email: '[email protected]'
pre-commit: ./.github/.pre-commit.js
config-file-path: ./.github/.config.js
version-file: ./version.json
skip-version-file: true
skip-git-pull: true
pre-release: false
release-count: 5
- name: Create release
if: ${{ steps.changelog.outputs.skipped != 'true' }}
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.changelog }}
draft: true
- name: Upload version information
uses: actions/upload-artifact@v3
with:
name: version
path: gradle.properties
build:
if: ${{ needs.changelog.outputs.skipped != 'true' }}
runs-on: ${{ matrix.os }}
needs: [changelog] # Build needs the new version number
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3 # Download version information from changelog
with:
name: version
- name: Set up JDK 16
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 16
cache: gradle
- name: Install FUSE (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install libfuse2 fuse
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run custom gradle package
run: gradle packageForRelease
- name: Upload files to release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.changelog.outputs.tag }}
draft: true
files: releases/*
publish-release:
needs: [ build, changelog ]
if: ${{ needs.changelog.outputs.skipped != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Publish Release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.changelog.outputs.release_id }}