20 snapshot deployment #76
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: 20 snapshot deployment | |
on: | |
push: | |
branches: [ "next" ] | |
workflow_dispatch: | |
jobs: | |
snapshot: | |
environment: dev | |
env: | |
REPOSILITE_ID: '${{ vars.REPOSILITE_ID }}' | |
REPOSILITE_URL: '${{ vars.REPOSILITE_URL }}' | |
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 }}' | |
APP_FEATURE_PRODUCT: 'example.rcp.app.ui.feature.product' | |
APP_BUNDLE_PRODUCT: 'example.rcp.app.ui.plugin.product' | |
APP_FEATURE: 'example-rcp-app-ui-feature' | |
APP_BUNDLE: 'example-rcp-app-ui-plugin' | |
runs-on: ubuntu-latest | |
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') }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: | | |
8 | |
11 | |
17 | |
21 | |
- name: build | |
shell: bash | |
run: | | |
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 | |
./build.sh --jar-signing --deploy | |
continue-on-error: true | |
- name: create release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
REPOSILITE_ID: '${{ vars.REPOSILITE_ID }}' | |
REPOSILITE_URL: '${{ vars.REPOSILITE_URL }}' | |
REPOSILITE_USERNAME: '${{ secrets.REPOSILITE_USERNAME }}' | |
REPOSILITE_TOKEN: '${{ secrets.REPOSILITE_TOKEN }}' | |
run: | | |
PRODUCTS=$(find releng/products/target -name 'example.rcp.app.ui.*' -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) | |
version=$(grep -oPm1 "(?<=<version>)[^<]+" "pom.xml") | |
if [[ $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 | |
if [[ $version =~ (.*+SNAPSHOT.*+) ]]; then | |
gh release create snapshot_$major.$minor.$bugfix $PRODUCTS $REPO_BINARY $REPO_SDK -p | |
else | |
gh release create rel_$major.$minor.$bugfix $PRODUCTS $REPO_BINARY $REPO_SDK --latest | |
fi | |