Skip to content

Commit

Permalink
auto release stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
xxAROX committed Feb 17, 2024
1 parent 5fe396b commit 09be58e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 32 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ jobs:
prerelease: true
title: "Development release v${{ steps.metadata.outputs.VERSION }}"
files: "target/Presence-Man-Nukkit.jar"

- name: "Create latest_version-dev.txt"
run: "echo \"${{ steps.metadata.outputs.VERSION }}\" > latest_version-dev.txt"

- name: "Update version-dev.txt"
uses: "test-room-7/action-update-file@v1"
with:
file-path: latest_version.txt
commit-msg: "Updated development version to ${{ steps.metadata.outputs.VERSION }} - ci ignore"
github-token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 6 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- name: "Get version"
id: metadata
run: |
echo "NEW_VERSION=$(php -r 'echo (version_compare(yaml_parse_file(getcwd() . "/src/main/resources/plugin.yml")["version"], file_get_contents(__DIR__ + "/version-nukkit.txt"), ">") ? "y" : "n");')" >> $GITHUB_OUTPUT
echo "VERSION=$(php -r 'echo explode("+", explode("-", yaml_parse_file(getcwd() . "/src/main/resources/plugin.yml")["version"])[0])[0];')" >> $GITHUB_OUTPUT
echo "FULL_VERSION=$(php -r 'echo yaml_parse_file(getcwd() . "/src/main/resources/plugin.yml")["version"];')" >> $GITHUB_OUTPUT
echo "NAME=$(php -r 'echo yaml_parse_file(getcwd() . "/src/main/resources/plugin.yml")["name"];')" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -51,39 +50,14 @@ jobs:
automatic_release_tag: "v${{ steps.metadata.outputs.VERSION }}"
prerelease: false
title: "Release v${{ steps.metadata.outputs.VERSION }}"
files: "target/**.jar"
files: "target/Presence-Man-Nukkit.jar"

- name: "Create version-nukkit.txt"
if: "${{ steps.metadata.outputs.NEW_VERSION }} === 'y'"
run: "echo \"${{ steps.metadata.outputs.VERSION }}\" > version-nukkit.txt"
- name: "Create latest_version.txt"
run: "echo \"${{ steps.metadata.outputs.VERSION }}\" > latest_version.txt"

- name: "Update version.txt"
- name: "Update latest_version.txt"
uses: "test-room-7/action-update-file@v1"
if: "${{ steps.metadata.outputs.NEW_VERSION }} === 'y'"
with:
file-path: version-nukkit.txt
commit-msg: Updated version - ci ignore
file-path: latest_version.txt
commit-msg: "Updated latest version to ${{ steps.metadata.outputs.VERSION }} - ci ignore"
github-token: ${{ secrets.GITHUB_TOKEN }}
committer-name: "xxAROX"
committer-email: "[email protected]"

#- name: "Pushes latest version-nukkit.txt file"
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
# with:
# source_file: 'version-nukkit.txt'
# destination_repo: 'Presence-Man/releases'
# destination_folder: ''
# user_email: '[email protected]'
# user_name: 'xxAROX'
# commit_message: 'Updated "Nukkit Client" version'

#- name: Release to public
# uses: softprops/action-gh-release@v1
# with:
# tag_name: "latest"
# name: "Latest releases"
# repository: "Presence-Man/releases"
# token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
# files: "target/Presence-Man-Nukkit.jar"
File renamed without changes.

0 comments on commit 09be58e

Please sign in to comment.