Skip to content

global: Remove 'flow' child #1422

global: Remove 'flow' child

global: Remove 'flow' child #1422

Workflow file for this run

name: Create Release
on:
pull_request:
types:
- closed
branches:
- master
- 7**
- 6**
- 5**
- 4**
jobs:
build-release:
if: github.event.pull_request.merged && startsWith(github.event.pull_request.title, 'Release ')
runs-on: ubuntu-latest
steps:
- name: Get version
id: get_version
run: echo '${{ github.head_ref }}' | sed 's/v/::set-output name=VERSION::/'
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- id: compile-membrane
name: Compile Membrane
run: |
mvn install \
--no-transfer-progress \
--batch-mode \
-DskipTests
- name: Setup next Snapshot version
run: |
cd distribution
if [ -e src/test/java/com/predic8/membrane/examples/env/ConsistentVersionNumbers.java ] ; then
CLASS=com.predic8.membrane.examples.env.ConsistentVersionNumbers
elif [ -e src/test/java/com/predic8/membrane/examples/withoutinternet/env/ConsistentVersionNumbers.java ] ; then
CLASS=com.predic8.membrane.examples.withoutinternet.env.ConsistentVersionNumbers
else
echo "ConsistentVersionNumbers.java not found."
exit 1
fi
mvn test-compile exec:java \
--no-transfer-progress \
--batch-mode \
-DmainClass=$CLASS \
-Dexec.classpathScope="test" \
-DmainArgs="-snapshot"
cd ..
- name: Create Pull Request for next Snapshot
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: "Snapshot version"
title: "Snapshot version"
author: "github-actions <github-actions@github.com>"
body: "Update all project `pom.xml` and related files to post-${{ steps.get_version.outputs.VERSION }} snapshot version"
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- id: install-secret-key
name: Install gpg secret key
run: |
# Install gpg secret key
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- id: build-artifact
name: Build release artefacts
run: |
mvn \
--no-transfer-progress \
--batch-mode \
-DskipTests \
-Pcentral \
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
clean verify
- name: Ensure release files exist
run: |
touch distribution/release-notes/${{ steps.get_version.outputs.VERSION }}.md
touch distribution/target/membrane-api-gateway-${{ steps.get_version.outputs.VERSION }}.zip.asc
- name: Create Release v${{ steps.get_version.outputs.VERSION }}
uses: ncipollo/release-action@v1
with:
name: v${{ steps.get_version.outputs.VERSION }}
tag: ${{ github.head_ref }}
commit: ${{ github.event.pull_request.merge_commit_sha }}
prerelease: true
# makeLatest: true
bodyFile: "distribution/release-notes/${{ steps.get_version.outputs.VERSION }}.md"
artifacts: "core/target/classes/com/predic8/membrane/core/config/json/membrane.schema.json,distribution/target/membrane-api-gateway-${{ steps.get_version.outputs.VERSION }}.zip,distribution/target/membrane-api-gateway-${{ steps.get_version.outputs.VERSION }}.zip.asc"
token: ${{ secrets.PAT }}
- name: Trigger website pipeline on GitLab
env:
GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
run: |
VERSION='${{ steps.get_version.outputs.VERSION }}'
curl -q -X POST --fail \
--connect-timeout 10 \
--max-time 30 \
-F token="${GITLAB_TRIGGER_TOKEN}" \
-F ref=main \
-F "variables[MEMBRANE_VERSION]=${VERSION}" \
https://gitlab.predic8.de/api/v4/projects/prod%2Fmembrane-api.io/trigger/pipeline