Skip to content

shippingAmountExcluded added (#156) #14

shippingAmountExcluded added (#156)

shippingAmountExcluded added (#156) #14

Workflow file for this run

name: Java CI with Maven
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- run: |
set -e
version_new="2.0."$((111+${{github.run_number}}))
version=$(cat VERSION)
sed -i -e 's/'$version'/'$version_new'/g' VERSION README.md
echo "ver=$version_new" >> $GITHUB_ENV
- name: Set version with Maven
run: mvn versions:set -DnewVersion=${{env.ver}}
- name: Clean install with Maven
run: mvn clean install
- name: Git Tasks
run: |
set -e
git config user.name "iyzico-ci"
git config user.email iyzico-ci@iyzico.com
git add .
git commit -m "Automatic commit by iyzico-ci v${{env.ver}}"
git push origin master
git tag -a v${{env.ver}} -m "Automatic tag by iyzico-ci v${{env.ver}}"
git push origin v${{env.ver}}
- name: Github Release
run: |
echo "Creating GitHub release..."
create_asset_json=$( curl -# -XPOST -H "Authorization: token ${{secrets.TOKEN_GITHUB}}" -H "Content-Type: application/json" -H "Accept:application/json" --data-binary '{"tag_name": "v${{env.ver}}","target_commitish": "master","name": "iyzipay-java ${{env.ver}}","body": "version ${{env.ver}}","draft": false,"prerelease": false}' https://api.github.com/repos/iyzico/iyzipay-java/releases )
echo $create_asset_json
echo "GitHub release created!"
upload_url=$( echo $create_asset_json | python -c 'import json,sys;obj=json.load(sys.stdin);print (obj["upload_url"][0:obj["upload_url"].find("{")]);' )
echo $upload_url
echo "Uploading GitHub release asset..."
upload_artifact="iyzipay-java-"${{env.ver}}".jar"
upload_assets_url=${upload_url}"?name="${upload_artifact}
echo "Artifact "${upload_artifact}" will be uploaded to "${upload_assets_url}
upload_asset_json=$( curl -# -XPOST -H "Authorization: token ${{secrets.TOKEN_GITHUB}}" -H "Content-Type: application/octet-stream" --data-binary "@target/"${upload_artifact} $upload_assets_url )
echo $upload_asset_json
echo "GitHub release asset uploaded!"
- name: Sonatype Deploy
run: mvn deploy -Dsg
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}