This repository was archived by the owner on Apr 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040 - name : Replace version on project gradle.properties
4141 run : |
42- cd ${{ steps.module.outputs.module_name }}
42+ cd ${{ inputs.project }}
4343 sed -i "/^VERSION=/ s/=.*/=${{ inputs.version }}/" gradle.properties
4444
4545 - name : remove SNAPSHOT on root gradle.properties
Original file line number Diff line number Diff line change 1+ name : record
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ project :
7+ description : " Project to update."
8+ type : string
9+ required : true
10+ version :
11+ description : " Version to rewrite in gradle.properties."
12+ type : string
13+ required : true
14+
15+ env :
16+ GRADLE_OPTS : -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=2g"
17+ JDK_VERSION : 19
18+
19+ jobs :
20+ check :
21+ runs-on : ubuntu-latest
22+ outputs :
23+ check : ${{ steps.check.outputs.record }}
24+
25+ steps :
26+ - uses : actions/checkout@v3
27+
28+ - name : Check if module needs to be recorded
29+ id : check
30+ run : |
31+ # check if CURRENT_RELEASE is present in gradle.properties
32+ cd ${{ inputs.project }}
33+
34+ if grep -q "^CURRENT_RELEASE=" gradle.properties; then
35+ echo "CURRENT_RELEASE is present"
36+ echo "record=true" >> $GITHUB_OUTPUT
37+ else
38+ echo "CURRENT_RELEASE is not present"
39+ echo "record=false" >> $GITHUB_OUTPUT
40+ fi
41+
42+ record :
43+ needs : check
44+ if : needs.check.outputs.check == 'true'
45+ runs-on : ubuntu-latest
46+
47+ permissions :
48+ contents : write
49+ pull-requests : write
50+
51+ steps :
52+ - uses : actions/checkout@v3
53+ with :
54+ fetch-depth : 0
55+
56+ - name : Update previous release version
57+ run : |
58+ cd ${{ inputs.project }}
59+ sed -i "/^CURRENT_RELEASE=/ s/=.*/=${{ inputs.version }}/" gradle.properties
60+
61+ - name : Commit latest docs
62+ run : |
63+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
64+ git config --local user.name "github-actions[bot]"
65+ git commit -am "chore(gradle): record current release version [skip-ci]"
66+
67+ - name : Push to repository
68+ uses : ad-m/github-push-action@master
69+ with :
70+ github_token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -47,12 +47,15 @@ jobs:
4747 - name : remove SNAPSHOT on root gradle.properties
4848 run : sed -i '/^VERSION=/ s/-SNAPSHOT//' gradle.properties
4949
50- # this avoids relying on snapshot dependency on kipher-core
50+ # this avoids relying on early-version snapshot dependency on kipher-core
5151 - name : remove SNAPSHOT suffix on kipher-core version
5252 if : ${{ steps.module.outputs.module_name }} != "kipher-core"
5353 run : |
5454 cd kipher-core
55- sed -i '/^VERSION=/ s/-SNAPSHOT//' gradle.properties
55+ # remove VERSION from gradle.properties
56+ sed -i '/VERSION/d' gradle.properties
57+ # use CURRENT_RELEASE as VERSION
58+ sed -i "s/CURRENT_RELEASE/VERSION/" gradle.properties
5659
5760 - name : replace version on project gradle.properties
5861 run : |
8285 uses : mindsers/changelog-reader-action@v2
8386 with :
8487 validation_level : warn
85- version : ${{ steps.version_name .outputs.version }}
88+ version : ${{ steps.tag .outputs.version }}
8689 path : docs/CHANGELOG-${{ steps.module.outputs.module_name }}.md
8790
8891 - name : Create release
@@ -99,6 +102,14 @@ jobs:
99102 artifacts : |
100103 ${{ steps.module.outputs.module_name }}/build/libs/*
101104
105+ record :
106+ needs : publish
107+ uses : ./.github/workflows/release-record.yml
108+ with :
109+ project : ${{ needs.publish.outputs.module_name }}
110+ version : ${{ needs.publish.outputs.version }}
111+ secrets : inherit
112+
102113 docs :
103114 needs : publish
104115 uses : ./.github/workflows/docs.yml
Original file line number Diff line number Diff line change 11ARTIFACT_ID =kipher-core
22VERSION =0.2.0-SNAPSHOT
33
4+ # This is used for the release process,
5+ # to avoid relying on early versions declared in VERSION.
6+ CURRENT_RELEASE =0.1.0
7+
48POM_NAME =kipher-core
59POM_DESCRIPTION =Common utility libraries used by other kipher modules.
610
You can’t perform that action at this time.
0 commit comments