2023-12-12 00:28:37 -05:00
|
|
|
name: Publish Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
tags:
|
2023-12-12 00:29:46 -05:00
|
|
|
- '*'
|
2023-12-12 00:28:37 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
name: Publish Release
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [ubuntu-latest]
|
|
|
|
java-version: [8]
|
|
|
|
maven-version: [3.9.4]
|
|
|
|
runs-on: ${{ matrix.arch }}
|
|
|
|
|
|
|
|
# Steps
|
|
|
|
steps:
|
|
|
|
# Checkout the repo
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
# Set up JDK
|
|
|
|
- name: Set up JDK
|
|
|
|
uses: https://github.com/actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
distribution: zulu
|
|
|
|
java-version: ${{ matrix.java-version }}
|
|
|
|
cache: maven
|
|
|
|
cache-dependency-path: pom.xml
|
|
|
|
|
|
|
|
# Setup Maven
|
|
|
|
- name: Set up Maven
|
|
|
|
uses: https://github.com/stCarolas/setup-maven@v4.5
|
|
|
|
with:
|
|
|
|
maven-version: ${{ matrix.maven-version }}
|
|
|
|
|
|
|
|
# Configure Maven settings
|
|
|
|
- name: Maven Settings
|
2024-11-03 16:01:17 +00:00
|
|
|
uses: https://github.com/s4u/maven-settings-action@v3.1.0
|
2023-12-12 00:28:37 -05:00
|
|
|
with:
|
|
|
|
servers: |-
|
|
|
|
[
|
|
|
|
{
|
2023-12-12 00:53:01 -05:00
|
|
|
"id": "rainnny-repo-public",
|
2023-12-12 00:28:37 -05:00
|
|
|
"username": "${{ secrets.PRIVATE_MAVEN_USER }}",
|
|
|
|
"password": "${{ secrets.PRIVATE_MAVEN_PASS }}"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
# Build the project
|
|
|
|
- name: Maven Build
|
2023-12-12 00:33:45 -05:00
|
|
|
run: mvn clean package -e -T6C
|
2023-12-12 00:28:37 -05:00
|
|
|
|
|
|
|
# Publish to Maven
|
|
|
|
- name: Publish to Maven
|
2023-12-12 00:43:48 -05:00
|
|
|
run: |
|
|
|
|
chmod +x ./scripts/deploy.sh
|
|
|
|
./scripts/deploy.sh
|
2023-12-12 00:28:37 -05:00
|
|
|
|
|
|
|
# Generate changelog
|
|
|
|
- name: Generate Changelog
|
|
|
|
id: changelog
|
|
|
|
uses: https://github.com/mathiasvr/command-output@v2.0.0
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s --skip-unstable
|
|
|
|
sed -i 's/commits/commit/g' CHANGELOG.md
|
|
|
|
cat CHANGELOG.md
|
|
|
|
|
|
|
|
# Extract the project version
|
|
|
|
# so we can use it later
|
|
|
|
- name: Extract Maven project version
|
|
|
|
shell: bash -l {0}
|
|
|
|
run: |
|
|
|
|
RELEASE_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
|
|
|
|
echo "Project version: $RELEASE_VERSION"
|
|
|
|
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
# Publish a new release to Gitea
|
|
|
|
- name: Publish Release
|
|
|
|
id: publish-release
|
|
|
|
uses: https://git.rainnny.club/Rainnny/release-action@main
|
|
|
|
with:
|
|
|
|
api_key: ${{ secrets.RELEASE_ACCESS_TOKEN }}
|
|
|
|
tag: Feather-${{ env.RELEASE_VERSION }}
|
|
|
|
title: v${{ env.RELEASE_VERSION }}
|
|
|
|
body: |-
|
|
|
|
${{ steps.changelog.outputs.stdout }}
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
## Maven
|
|
|
|
```xml
|
|
|
|
<dependency>
|
|
|
|
<groupId>me.braydon</groupId>
|
|
|
|
<artifactId>Feather</artifactId>
|
|
|
|
<version>${{ env.RELEASE_VERSION }}</version>
|
|
|
|
</dependency>
|
|
|
|
```
|
|
|
|
|
|
|
|
## Gradle (Kotlin DSL)
|
|
|
|
```kotlin
|
2023-12-12 01:34:39 -05:00
|
|
|
implementation("me.braydon:Feather:${{ env.RELEASE_VERSION }}")
|
2023-12-12 00:28:37 -05:00
|
|
|
```
|
|
|
|
files: target/Feather-*.jar
|
|
|
|
env:
|
|
|
|
GOPATH: /usr/local/go
|
|
|
|
PATH: /usr/local/go/bin:${{ env.PATH }}
|