Tag & Release #38
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: Tag & Release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: "Version number to be released (use semver semantic: 'X.Y.Z')" | |
required: true | |
nextDevelopmentVersion: | |
description: "Next development version to be set (use semver semantic: 'X.Y.Z', `-SNAPSHOT` artifact's suffix will be automatically added)" | |
required: true | |
permissions: | |
contents: write | |
deployments: write | |
pull-requests: write | |
jobs: | |
Releasing: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v4 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: OSSRH_USER | |
server-password: OSSRH_PWD | |
gpg-private-key: ${{ secrets.GPG_KEY }} | |
gpg-passphrase: GPG_PWD | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Configure git | |
run: | | |
git config user.name git | |
git config user.email [email protected] | |
git config --global credential.helper cache | |
git config --global credential.https://github.com.username ${{ env.GITHUB_USERNAME }} | |
git config --global credential.https://github.com.password ${{ env.GITHUB_TOKEN }} | |
env: | |
GITHUB_USERNAME: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and switch to dedicated release branch | |
run: | | |
git checkout -b "release-${{ github.event.inputs.releaseVersion }}" | |
# e2e requirements | |
- name: Checkout sinch-sdk-mockserver repository | |
uses: actions/checkout@v3 | |
with: | |
repository: sinch/sinch-sdk-mockserver | |
token: ${{ secrets.MOCKSERVER_REPO_PAT_CI }} | |
fetch-depth: 0 | |
path: sinch-sdk-mockserver | |
- name: Install Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y docker-compose | |
- name: Start mock servers with Docker Compose | |
run: | | |
cd sinch-sdk-mockserver | |
docker-compose up -d | |
- name: Link to feature files | |
run: | | |
ln -s ${{ github.workspace }}/sinch-sdk-mockserver/features client/src/test/resources | |
- name: Release | |
run: scripts/release.sh | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} | |
NEXT_VERSION: ${{ github.event.inputs.nextDevelopmentVersion }} | |
OSSRH_USER: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PWD: ${{ secrets.OSSRH_PWD }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_PWD: ${{ secrets.GPG_PWD }} | |
GITHUB_USERNAME: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create dedicated release pull request | |
run: gh pr create -d -B main -H "release-${RELEASE_VERSION}" --title "Merge release '"release-${RELEASE_VERSION}"' branch into main" --body 'Created by Github action' | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |