-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
267 additions
and
269 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,17 +28,40 @@ jobs: | |
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Execute permission for renaming script | ||
run: chmod +x renaming.sh | ||
- name: Running renaming script | ||
run: ./renaming.sh | ||
|
||
# Publishing to dev-builds branch | ||
- name: GitHub Pages | ||
if: success() | ||
uses: crazy-max/[email protected] | ||
run: chmod +x main.sh | ||
- name: Running main script | ||
run: ./.github/workflows/main.sh | ||
|
||
# Artifact upload | ||
- name: Uploading artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
#name: ${{ env.BUILDNAME }}.jar | ||
name: UNZIP_ME_${{ env.BUILDNAME }} | ||
path: build/libs/${{ env.BUILDNAME }}.jar | ||
- name: Create a Release | ||
if: ${{ env.SHOULD_PUBLISH }} | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
build_dir: build/libs | ||
target_branch: dev-builds | ||
keep_history: false | ||
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag | ||
tag_name: ${{ env.VERSION }} | ||
# The name of the release. For example, `Release v1.0.1` | ||
release_name: SimpleAuth ${{ env.VERSION }} | ||
# Text describing the contents of the tag. | ||
body: This release was created automatically, since version was bumped. Should be stable unless I messed up something. | ||
- name: Upload a Release Asset | ||
if: ${{ env.SHOULD_PUBLISH }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_PAT: ${{ secrets.pat }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# The URL for uploading assets to the release | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
# The path to the asset you want to upload | ||
asset_path: build/libs/${{ env.BUILDNAME }}.jar | ||
# The name of the asset you want to upload | ||
asset_name: ${{ env.PROJECT_ID }}_fabric-${{ env.VERSION }}-${{ env.MC_VERSION }}.jar | ||
asset_content_type: application/zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Setting the variables | ||
projectId="$(grep 'archives_base_name' gradle.properties | sed 's/archives_base_name = //g;s/ //g;s/,//g;s/"//g')" | ||
version="$(grep 'mod_version' gradle.properties | grep -o '[0-9]*\.[0-9]*\.[0-9]*')" | ||
mcVersion="$(grep 'minecraft_version' gradle.properties | sed 's/minecraft_version=//g;s/ //g;s/,//g;s/"//g')" | ||
|
||
cd ./build/libs || exit | ||
|
||
buildName="$projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion" | ||
|
||
echo "Build is going to be renamed: $buildName.jar" | ||
# Renaming the dev build | ||
mv "$projectId-$version-$mcVersion.jar" "$buildName.jar" | ||
|
||
# Setting the buildname for GH actions | ||
echo "BUILDNAME=$buildName" >> $GITHUB_ENV | ||
echo "PROJECT_ID=$projectId" >> $GITHUB_ENV | ||
echo "VERSION=$version" >> $GITHUB_ENV | ||
echo "MC_VERSION=$mcVersion" >> $GITHUB_ENV | ||
|
||
|
||
# Checks if build is stable (I always bump version when I release stable, uploadable version) | ||
latestRelease=$(curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")') | ||
echo "Latest release is: $latestRelease" | ||
|
||
|
||
if [ "$latestRelease" == "$version" ]; then | ||
echo "No need to publish release. Not necesarry stable yet." | ||
else | ||
echo "Hooray! New release!" | ||
echo "SHOULD_PUBLISH=true" >> $GITHUB_ENV | ||
fi |
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
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.