Skip to content

Release

Release #39

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y.Z-SNAPSHOT"
env:
WEBRTC_CACHE_BRANCH: 7204
WEBRTC_CHECKOUT_FOLDER: webrtc
WEBRTC_INSTALL_FOLDER: webrtc/build
jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
release_version: ${{ steps.git-cliff.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Generate changelog for the current build
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: .github/changelog/cliff-release.toml
args: -v -u --strip footer --bump --use-branch-tags
- name: Update CHANGELOG.md
uses: orhun/git-cliff-action@v4
with:
config: .github/changelog/cliff.toml
args: -v --bump --use-branch-tags
env:
OUTPUT: CHANGELOG.md
- name: Commit CHANGELOG.md
run: |
git add CHANGELOG.md
git commit -m "chore(release): Update CHANGELOG.md for ${{ steps.git-cliff.outputs.version }}"
git push
prepare-release:
name: Prepare release
needs: changelog
outputs:
release_body: ${{ needs.changelog.outputs.release_body }}
release_version: ${{ needs.changelog.outputs.release_version }}
strategy:
fail-fast: false
matrix:
platform:
- name: linux_x86-64
runs-on: ubuntu-22.04
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: main
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
- id: prepare
name: Prepare release build
uses: ./.github/actions/prepare-linux
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Update development version
uses: actions/checkout@v5
with:
ref: main
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- run: |
mvn release:prepare -DskipTests -DpushChanges=false -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
# Get the release version from the release.properties file
RELEASE_VERSION=$(grep "project.rel.dev.onvoid.webrtc\\\:webrtc-java=" release.properties | cut -d'=' -f2)
echo "Extracted release version from release.properties: $RELEASE_VERSION"
# Update versions.js file
echo "Updating versions.js with release version: $RELEASE_VERSION and development version: ${{ github.event.inputs.developmentVersion }}"
sed -i "s/VERSION: '.*'/VERSION: '$RELEASE_VERSION'/g" docs/assets/versions.js
sed -i "s/VERSION_SNAPSHOT: '.*'/VERSION_SNAPSHOT: '${{ github.event.inputs.developmentVersion }}'/g" docs/assets/versions.js
# Add the updated file to the existing commit
git add docs/assets/versions.js
git commit --amend --no-edit
git push
git push --tags
build-windows:
needs: prepare-release
outputs:
release_body: ${{ needs.prepare-release.outputs.release_body }}
release_version: ${{ needs.prepare-release.outputs.release_version }}
strategy:
fail-fast: false
matrix:
platform:
- name: windows_x86_64
runs-on: windows-2022
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-tags: true
- name: Get tag from current branch
id: tag-selector
shell: bash
run: |
git fetch -a
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
git checkout $tag
- id: prepare
name: Prepare release build
uses: ./.github/actions/prepare-windows
- id: maven-build
name: Maven build
uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
build-linux:
needs: prepare-release
strategy:
fail-fast: false
matrix:
platform:
- name: linux_arm
runs-on: ubuntu-22.04
- name: linux_arm64
runs-on: ubuntu-22.04
- name: linux_x86-64
runs-on: ubuntu-22.04
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-tags: true
- name: Get tag from current branch
id: tag-selector
run: |
git fetch -a
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
git checkout $tag
- id: prepare-build
name: Prepare release build
uses: ./.github/actions/prepare-linux
- id: maven-build
name: Maven build
uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
build-macos:
needs: prepare-release
strategy:
fail-fast: false
matrix:
platform:
- name: macos_x86-64
runs-on: macos-14
- name: macos_arm64
runs-on: macos-14
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-tags: true
- name: Get tag from current branch
id: tag-selector
run: |
git fetch -a
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
git checkout $tag
- id: prepare-build
name: Prepare release build
uses: ./.github/actions/prepare-macos
- id: maven-build-arm64
name: Maven build - Apple Silicon
if: matrix.platform.name == 'macos_arm64'
uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- id: maven-build-x86_64
name: Maven build - Intel
if: matrix.platform.name == 'macos_x86-64'
uses: ./.github/actions/release-macos-x86_64
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
publish-release:
name: Publish GitHub release
needs: [build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="${{ needs.build-windows.outputs.release_version }}"
body="${{ needs.build-windows.outputs.release_body }}"
gh release create $version -d -t "Release $version" -n "$body"