Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ jobs:
env:
GH_TOKEN: ${{ secrets.DEPS_TOKEN }}
run: bash .github/scripts/prepare-release.sh
- name: Set dated development version
- name: Set build version
id: dev
shell: bash
run: |
dev_version="DEV-$(date -u +%Y%m%d-%H%M)"
dev_version="main-SNAPSHOT"
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
dev_version="DEV-$(date -u +%Y%m%d-%H%M)"
fi
mvn -B --no-transfer-progress -P'!deploy-live' org.codehaus.mojo:versions-maven-plugin:2.22.0:set \
-DnewVersion="$dev_version" -DgenerateBackupPoms=false
mvn -B --no-transfer-progress -P'!deploy-live' help:evaluate \
Expand All @@ -54,7 +57,8 @@ jobs:
BUILD_VERSION: ${{ steps.dev.outputs.version }}
run: python3 .github/scripts/plugin-artifact.py --jar "$ARTIFACT_PATH" --version "$BUILD_VERSION"

- uses: actions/upload-artifact@v7
- if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: ${{ steps.dev.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}
path: |
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,13 @@ jobs:
bash .github/scripts/prepare-release.sh
fi

- name: Check Maven version and build
- name: Set version from tag and build
id: maven
env:
TAG: ${{ github.ref_name }}
run: |
version_file="$RUNNER_TEMP/maven-release-version"
mvn -B --no-transfer-progress -P'!deploy-live' help:evaluate \
-Dexpression=project.version -Doutput="$version_file"
[[ "$(cat "$version_file")" == "${TAG#v}" ]] || {
echo '::error::The tag must match project.version exactly.'
exit 1
}
mvn -B --no-transfer-progress -P'!deploy-live' org.codehaus.mojo:versions-maven-plugin:2.22.0:set \
-DnewVersion="${TAG#v}" -DgenerateBackupPoms=false
mvn -B --no-transfer-progress -P'!deploy-live' help:evaluate \
-Dexpression=project.build.finalName -Doutput="$RUNNER_TEMP/final-name"
final_name=$(cat "$RUNNER_TEMP/final-name")
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.tfminecraft</groupId>
<artifactId>magic</artifactId>
<version>0.2.0</version>
<version>main-SNAPSHOT</version>

<properties>
<maven.compiler.release>21</maven.compiler.release>
Expand Down