Skip to content

updare change note

updare change note #43

Workflow file for this run

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'
cache: 'gradle'
- name: Create resources directory
run: mkdir -p src/main/resources
- name: Create config.properties file
run: |
echo "AYMOAPI_KEY=${{ secrets.AYMOAPI_KEY }}" >> src/main/resources/config.properties
echo "BASE_URL=${{ secrets.BASE_URL }}" >> src/main/resources/config.properties
echo "HELPFUL_ASSISTANT=${{ secrets.HELPFUL_ASSISTANT }}" >> src/main/resources/config.properties
echo "REFACTOR_CODE_RQ=${{ secrets.REFACTOR_CODE_RQ }}" >> src/main/resources/config.properties
echo "MODEL=${{ secrets.MODEL }}" >> src/main/resources/config.properties
echo "GENERATE_UNIT_TEST_RQ=${{ secrets.GENERATE_UNIT_TEST_RQ }}" >> src/main/resources/config.properties
echo "REFACTOR_SELECTED_CODE_RQ=${{ secrets.REFACTOR_SELECTED_CODE_RQ }}" >> src/main/resources/config.properties
echo "SCAN_RQ=${{ secrets.SCAN_RQ }}" >> src/main/resources/config.properties
echo "SCAN_ROLE=${{ secrets.SCAN_ROLE }}" >> src/main/resources/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 add increment_version.sh
git commit -m "Bump version to $NEW_VERSION"
git tag $NEW_VERSION
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git --tags
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/aymenbs2/AymoAi.git HEAD:main
- 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
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download zip artifact
uses: actions/download-artifact@v2
with:
name: build-artifact
path: .
- name: Extract artifact
run: unzip -o artifact.zip -d .
# - name: Sign Plugin
# env:
# AYMOAI_PASS: ${{ secrets.AYMOAI_PASS }}
# AYMOAI_TOCKEN: ${{ secrets.AYMOAI_TOCKEN }}
# run: ./gradlew signPlugin publishPlugin