Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/scripts/osc-api-check.sh

This file was deleted.

27 changes: 3 additions & 24 deletions .github/scripts/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,18 @@
set -e

root=$(cd "$(dirname $0)/../.." && pwd)
if [ -e "$root/.auto-release-abort" ]; then
echo "previous step triggered stop, abort"
exit 0
fi

# build new version number
local_sdk_version=$(cat $root/sdk_version)
local_sdk_version_major=$(echo $local_sdk_version | cut -d '.' -f 1)
local_sdk_version_minor=$(echo $local_sdk_version | cut -d '.' -f 2)
new_sdk_version_minor=$(( local_sdk_version_minor + 1 ))
new_sdk_version="$local_sdk_version_major.$new_sdk_version_minor.0"

branch_name="autobuild-$new_sdk_version"
git branch -m $branch_name

echo "$new_sdk_version" > $root/sdk_version

# build release notes
new_api_version=$(cat $root/api_version)
release_notes="# $new_sdk_version

- SDK update for Outscale API v$new_api_version

"
echo "$release_notes$(cat $root/changelog.md)" > $root/changelog.md

# generate SDK
cd "$root"
sed -i "<outscale-api-version>s|.*|${new_api_version}</outscale-api-version>|" pom.xml

# setup git && commit
git config user.name "Outscale Bot"
git config user.email "opensource+bot@outscale.com"
for f in src dist pom.xml; do
git add $f || true
done
git commit -asm "osc-sdk-java v$new_sdk_version"
new_api_version=$(cat $root/api_version)
sed -i "s|<outscale-api-version>.*|<outscale-api-version>${new_api_version}</outscale-api-version>|" pom.xml
29 changes: 0 additions & 29 deletions .github/scripts/release-check-duplicate.sh

This file was deleted.

27 changes: 0 additions & 27 deletions .github/scripts/release-pr.sh

This file was deleted.

18 changes: 0 additions & 18 deletions .github/scripts/release-push.sh

This file was deleted.

35 changes: 21 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ on:

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
auto-build:
environment: auto-build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
ref: main
- uses: chainguard-dev/actions/setup-gitsign@main
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5
with:
distribution: 'temurin'
Expand All @@ -25,18 +26,24 @@ jobs:

- name: Write Outscale API version to use
run: echo "${{ github.event.inputs.api_version }}" > api_version
- name: check for release duplicate
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: make release-check-duplicate

- name: auto-generate release
run: make release-build
- name: push release branch
run: make release-push
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: create pull request
run: make release-pr

- name: Get SDK version
id: get-sdk-version
run: |
echo "sdk_version=$(cat ./sdk_version)" >> "$GITHUB_OUTPUT"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8.1.0
with:
committer: "Outscale Bot <opensource+bot@outscale.com>"
author: "Outscale Bot <opensource+bot@outscale.com>"
commit-message: "🔖 release: osc-sdk-java v${{ env.sdk_version }}"
body: |
Automatic build of SDK v${{ env.sdk_version }} version based on Outscale API ${{ env.api_version }}.
title: "SDK v${{ env.sdk_version }}"
token: "${{ env.token }}"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
sdk_version: ${{ steps.get-sdk-version.outputs.sdk_version }}
api_version: ${{ github.event.inputs.api_version }}
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,10 @@ auto-release: auto-release-cleanup osc-api-check release-check-duplicate release
auto-release-cleanup:
rm -rf .auto-release-abort || true

.PHONY: osc-api-check
osc-api-check:
bash .github/scripts/osc-api-check.sh

.PHONY: release-check-duplicate
release-check-duplicate:
bash .github/scripts/release-check-duplicate.sh

.PHONY: release-build
release-build:
bash .github/scripts/release-build.sh

.PHONY: release-push
release-push:
bash .github/scripts/release-push.sh

.PHONY: release-pr
release-pr:
bash .github/scripts/release-pr.sh

.PHONY: local-deploy
local-deploy:
mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dgpg.skip
2 changes: 1 addition & 1 deletion sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<gitHost>github.com</gitHost>
<gitUserId>outscale</gitUserId>
<gitRepoId>osc-sdk-java</gitRepoId>
<inputSpec>https://raw.githubusercontent.com/outscale/osc-api-deploy/refs/tags/v${outscale-api-version}/outscale.yaml</inputSpec>
<inputSpec>https://raw.githubusercontent.com/outscale/osc-api-deploy/refs/tags/${outscale-api-version}/outscale.yaml</inputSpec>
<generatorName>java</generatorName>
<templateDirectory>templates</templateDirectory>
<groupId>io.github.outscale</groupId>
Expand Down
Loading