-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (74 loc) · 3.03 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build and Publish Plugin
on:
push:
branches:
- main
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Kotlin
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Create config.properties file
run: |
echo "AYMOAPI_KEY=${{ secrets.AYMOAPI_KEY }}" >> config.properties
echo "BASE_URL=${{ secrets.BASE_URL }}" >> config.properties
echo "HELPFUL_ASSISTANT=${{ secrets.HELPFUL_ASSISTANT }}" >> config.properties
echo "REFACTOR_CODE_RQ=${{ secrets.REFACTOR_CODE_RQ }}" >> config.properties
echo "MODEL=${{ secrets.MODEL }}" >> config.properties
echo "GENERATE_UNIT_TEST_RQ=${{ secrets.GENERATE_UNIT_TEST_RQ }}" >> config.properties
echo "REFACTOR_SELECTED_CODE_RQ=${{ secrets.REFACTOR_SELECTED_CODE_RQ }}" >> config.properties
echo "SCAN_RQ=${{ secrets.SCAN_RQ }}" >> config.properties
echo "SCAN_ROLE=${{ secrets.SCAN_ROLE }}" >> config.properties
- name: Download certificate chain file
run: echo "${{ secrets.AYMOAI_CHAIN }}" > $GITHUB_WORKSPACE/certificate_chain.pem
- name: Download private key file
run: echo "${{ secrets.AYMOAI_CERTIF }}" > $GITHUB_WORKSPACE/private_key.pem
- name: Make version increment script executable
run: chmod +x ./increment_version.sh
- name: Increment version
id: increment_version
run: |
new_version=$(./increment_version.sh)
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
- name: Update version in build.gradle.kts
run: |
sed -i "s/version = \".*\"/version = \"$NEW_VERSION\"/" build.gradle.kts
- name: Commit version bump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add build.gradle.kts
git commit -m "Bump version to $NEW_VERSION"
git tag $NEW_VERSION
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git --tags
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git
- name: Build with Gradle
run: ./gradlew build
- name: Create zip artifact
run: |
zip -r artifact.zip . -x ".git/*"
- name: Upload zip artifact
uses: actions/upload-artifact@v2
with:
name: build-artifact
path: artifact.zip
# - name: Sign Plugin
#env:
# AYMOAI_PASS: ${{ secrets.AYMOAI_PASS }}
# AYMOAI_TOCKEN: ${{ secrets.AYMOAI_TOCKEN }}
# run: ./gradlew signPlugin publishPlugin