Skip to content

Commit

Permalink
fix: πŸ› Dev build not working
Browse files Browse the repository at this point in the history
Rename the .github/workflow folder to
.github/workflows to please github.
Rename the workflow from PR to Dev Build.
Add permission to gradlew file.
  • Loading branch information
FYWinds committed Apr 28, 2023
1 parent 314c227 commit 17cb934
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/scripts/rename_artifact
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
for f in build/libs/*.jar; do
tmp=$(echo "$f" | sed "s/$VERSION/$SHORT_SHA/")
mv "$f" "$tmp"
done
4 changes: 4 additions & 0 deletions .github/scripts/set_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
echo "VERSION=$(./gradlew --console plain --quiet currentVersion -Prelease.quiet)" >> "$GITHUB_ENV"
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
echo "PROJECT_NAME=$(grep 'rootProject.name' ./settings.gradle.kts | awk -F ' = "|"' '{print $2}')" >> "$GITHUB_ENV"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR
name: Dev Build
on:
push:
branchs:
Expand All @@ -20,18 +20,19 @@ jobs:
fetch-depth: 0
- uses: gradle/gradle-build-action@v2
- name: Gradle Build
run: ./gradlew build
- name: Get Version
id: version
run: echo "VRESION=$(./gradlew --console plain --quiet currentVersion -Prelease.quiet)" >> $GITHUB_ENV
- name: Get Short SHA
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
run: chmod +x ./gradlew && ./gradlew build
- name: Set env variables
run: |
chmod +x .github/scripts/set_env
.github/scripts/set_env
- name: Rename Build
run: for f in ./build/libs/*.jar; do mv "$f" "$(echo "$f"|sed s/${VERSION}/CI-${SHORT_SHA}/)";done
run: |
chmod +x .github/scripts/rename_artifact
.github/scripts/rename_artifact
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: build
name: "[CI-${{ env.SHORT_SHA }}]${{ env.PROJECT_NAME }}"
path: build/libs/*-all.jar
retention-days: 30
if-no-files-found: errorl
if-no-files-found: error
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Publish
on:
push:
branches: [ 'master', 'main' ]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

Expand Down
File renamed without changes.

0 comments on commit 17cb934

Please sign in to comment.