Skip to content

Commit 6412843

Browse files
committed
feat: create tag after generating image
1 parent 9133384 commit 6412843

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.github/workflows/native.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ jobs:
2222

2323
- name: Build native image
2424
run: |
25-
./create-image.sh ${{ env.REPO_NAME }}-${{ matrix.os }}
25+
./create-image.sh ${{ matrix.os }}
2626
2727
- name: Commit & Push changes
2828
uses: actions-js/push@master
2929
with:
3030
rebase: true
31-
message: 'chore: binary image for ${{matrix.os}} - ${{date}}'
31+
tags: true
32+
message: 'chore: binary image for ${{matrix.os}}'
3233
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,6 @@ fabric.properties
9292
.idea/httpRequests
9393

9494
# Android studio 3.1+ serialized cache file
95-
.idea/caches/build_file_checksums.ser
95+
.idea/caches/build_file_checksums.ser
96+
97+
bin/local

create-image.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
IMAGE_NAME="json-schema-compiler"
1818
WORK_FOLDER="./target"
1919
RELEASES_FOLDER="./bin"
20+
TODAY=$(date +"%Y-%m-%d")
2021

2122
#see: https://graalvm.github.io/native-build-tools/latest/maven-plugin-quickstart.html#_build_a_native_executable_by_detecting_resources_with_the_agent
2223
echo "Running ./mvnw clean package"
@@ -35,5 +36,11 @@ if [[ $# -eq 0 ]] ; then
3536
exit 1
3637
fi
3738

38-
echo "Moving $WORK_FOLDER/$IMAGE_NAME"
39-
mv -f "$WORK_FOLDER/$IMAGE_NAME" "$RELEASES_FOLDER/$1"
39+
echo "Moving $WORK_FOLDER/$IMAGE_NAME to $RELEASES_FOLDER/$1/$IMAGE_NAME"
40+
mkdir -p "$RELEASES_FOLDER/$1"
41+
mv -f "$WORK_FOLDER/$IMAGE_NAME" "$RELEASES_FOLDER/$1/$IMAGE_NAME"
42+
43+
echo "Creating tag '$1-$TODAY'"
44+
git tag -a "$1-$TODAY" -m "Native image for $1, generated on $TODAY"
45+
echo "Moving tag $1-latest"
46+
git tag -af "$1-latest" -m "Latest version of the native image for $1"

0 commit comments

Comments
 (0)