30 release deployment #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 30 release deployment | |
on: | |
workflow_dispatch: | |
inputs: | |
release-version: | |
description: 'release-version' | |
required: true | |
type: string | |
next-snaphot-version: | |
description: 'next-snaphot-version' | |
required: true | |
type: string | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
env: | |
REPOSILITE_ID: '${{ vars.REPOSILITE_ID }}' | |
REPOSILITE_URL: '${{ vars.REPOSILITE_URL }}' | |
GPG_SIGNING_KEY: '${{ secrets.GPG_SIGNING_KEY }}' | |
REPOSILITE_USER_RELEASE: '${{ secrets.REPOSILITE_USER_RELEASE }}' | |
REPOSILITE_TOKEN_RELEASE: '${{ secrets.REPOSILITE_TOKEN_RELEASE }}' | |
REPOSILITE_USER_SNAPSHOT: '${{ secrets.REPOSILITE_USER_SNAPSHOT }}' | |
REPOSILITE_TOKEN_SNAPSHOT: '${{ secrets.REPOSILITE_TOKEN_SNAPSHOT }}' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
# - name: caching idefix / ~/.klibio | |
# uses: actions/cache@v3 | |
# with: | |
# path: | | |
# ~/.ecdev | |
# ~/.m2 | |
# ~/.p2 | |
# key: dev-${{ hashFiles('~/.klibio/klibio.sh') }} | |
- name: configure java versions | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: | | |
8 | |
11 | |
17 | |
21 | |
- name: Configure GPG Key | |
run: | | |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import | |
env: | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
- name: build | |
shell: bash | |
run: | | |
echo -e "#\n# build\n#\n" | |
echo "# configure environment for maven/tycho calls" | |
export JAVA_HOME_8=$JAVA_HOME_8_X64 | |
export JAVA_HOME_11=$JAVA_HOME_11_X64 | |
export JAVA_HOME_17=$JAVA_HOME_17_X64 | |
export JAVA_HOME_21=$JAVA_HOME_21_X64 | |
export PATH=$JAVA_HOME/bin:$PATH | |
echo -e "#\n# update to release version $RELEASE_VERSION\n#\n" | |
./mvnw org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$RELEASE_VERSION | |
git config user.name "$(git log -n 1 --pretty=format:%an)" | |
git config user.email "$(git log -n 1 --pretty=format:%ae)" | |
git add . && git commit -m "releasing $RELEASE_VERSION" && git push | |
echo -e "#\n# RELEASE build and deploy to artifactory\n#\n" | |
MAVEN_OPTS="-Dtycho.localArtifacts=ignore -Dmaven.repo.local=.local_m2_cache" | |
./build.sh --jar-signing --deploy | |
continue-on-error: true | |
- name: create release | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
pom_version=$(grep -oPm1 "(?<=<version>)[^<]+" "pom.xml") | |
if [[ $pom_version =~ ([0-9]+)\.([0-9]+)\.([0-9]+)(.*) ]]; then | |
major="${BASH_REMATCH[1]}" | |
minor="${BASH_REMATCH[2]}" | |
bugfix="${BASH_REMATCH[3]}" | |
snapshot="${BASH_REMATCH[4]}" | |
else | |
echo "Version format not recognized." | |
exit 1 | |
fi | |
version=$major.$minor.$bugfix | |
release=rel_$version | |
snapshot=snapshot_$version | |
PRODUCTS=$(find releng/products/target -name 'example.rcp.app.ui.*' -type f) | |
REPO_PRODUCT=$(find releng/products/target -name 'products-*.zip' -type f) | |
REPO_BINARY=$(find releng/repo.binary/target -name 'repo.binary-*.zip' -type f) | |
REPO_SDK=$(find releng/repo.sdk/target -name 'repo.sdk-*.zip' -type f) | |
if [[ $pom_version =~ (.*+SNAPSHOT.*+) ]]; then | |
echo "eval if snapshot release $snapshot is already existing" | |
gh release list --json tagName | jq --arg jqSnapshot "$snapshot" 'select(.[].tagName == $jqSnapshot)' > snapshot.json | |
if [[ -s snapshot.json ]]; then | |
echo "delete existiong snapshot release, before creating new one" | |
gh release delete $snapshot | |
git push --delete origin $snapshot | |
fi | |
gh release create $snapshot $PRODUCTS $REPO_BINARY $REPO_PRODUCT $REPO_SDK -p | |
else | |
gh release create $release $PRODUCTS $REPO_BINARY $REPO_PRODUCT $REPO_SDK --latest | |
fi | |
- name: start next development cycle | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | |
echo -e "#\n# start next development cycle with new version $NEXT_SNAPSHOT_VERSION\n#\n" | |
./mvnw org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$NEXT_SNAPSHOT_VERSION | |
git add . && git commit -m "starting next dev cycle - new version $NEXT_SNAPSHOT_VERSION" && git push | |
git tag -a $NEXT_SNAPSHOT_VERSION -m "start dev cycle with version $NEXT_SNAPSHOT_VERSION" && git push --tags | |
continue-on-error: false |