Merge pull request #70 from Nopock/Nopock-patch-2 #199
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Make sure to append --release to your commit msgs for a release and update the repository secret with the new version starting with v | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 8.0.352+8 | |
distribution: temurin | |
cache: 'gradle' | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
id: build | |
run: ./gradlew build --no-daemon | |
- name: Create Github Release | |
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'main')" | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: | | |
# Changes | |
- This is an automatic release... | |
- These notes will be updated shortly :) | |
`build.gradle.kts` | |
```kts | |
repositories { | |
maven("https://jitpack.io") | |
} | |
dependencies { | |
implementation("com.github.Nopock:Store:${{ secrets.RELEASE_VERSION }}") | |
} | |
``` | |
`pom.xml` | |
```xml | |
<repositories> | |
<repository> | |
<id>jitpack</id> | |
<url>https://jitpack.io</url> | |
</repository> | |
</repositories> | |
<dependencies> | |
<depedency> | |
<groupId>com.github.Nopock</groupId> | |
<artifactId>Store</artifactId> | |
<version>${{ secrets.RELEASE_VERSION }}</version> | |
</dependency> | |
</dependencies> | |
``` | |
tag_name: ${{ secrets.RELEASE_VERSION}} | |
release_name: Release ${{ secrets.RELEASE_VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Jar to Github | |
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'main')" | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: /home/runner/work/Store/Store/build/libs/Store-1.0.jar | |
asset_name: store.jar | |
asset_content_type: application/jar |