Skip to content

Release new version

Release new version #1

Workflow file for this run

name: Release new version
on:
workflow_dispatch:
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
# action-gh-release creates the GitHub Release via GITHUB_TOKEN, which needs write access.
permissions:
contents: write
env:
YOSPACE_USER: ${{ secrets.YOSPACE_USER }}
YOSPACE_TOKEN: ${{ secrets.YOSPACE_TOKEN }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Deploy key with write access, allowed to bypass main's branch protection.
ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }}
ref: main
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5
# Validate before mutating anything: never tag or publish a broken build.
- name: Build
run: ./gradlew build
- name: Determine next version from CHANGELOG
id: version
run: echo "next=$(./gradlew decideReleaseVersion -q --console=plain)" >> "$GITHUB_OUTPUT"
- name: Bump version
run: ./gradlew bumpVersion -PnewVersion=${{ steps.version.outputs.next }}
- name: Promote CHANGELOG unreleased section
run: ./gradlew patchChangelog
- name: Extract release notes
run: ./gradlew getChangelog -q --console=plain --no-header --no-summary --no-empty-sections --project-version=${{ steps.version.outputs.next }} --output-file=build/release-notes.md
- name: Commit, tag and push
run: |
git config user.name 'Automated Release'
git config user.email 'release-automation@bitmovin.com'
git add gradle.properties CHANGELOG.md
git commit -m "Release ${{ steps.version.outputs.next }}"
git tag -a "${{ steps.version.outputs.next }}" -m "${{ steps.version.outputs.next }}"
git push origin main
git push origin "${{ steps.version.outputs.next }}"
- name: Publish to Artifactory
run: ./gradlew artifactoryPublish
# Promote the release from the internal staging repo to the public, anonymously
# readable repo. Mirrors the copy step used by player-android and the analytics SDK.
- name: Promote artifact to public-releases
run: |
VERSION="${{ steps.version.outputs.next }}"
ARTIFACT_PATH="com/bitmovin/player/integration/yospace/${VERSION}"
HTTP_STATUS=$(curl -sS -o /tmp/copy-response.json -w '%{http_code}' \
-X POST -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASSWORD}" \
"https://bitmovin.jfrog.io/bitmovin/api/copy/libs-release-local/${ARTIFACT_PATH}?to=/public-releases/${ARTIFACT_PATH}")
cat /tmp/copy-response.json
if [ "$HTTP_STATUS" != "200" ]; then
echo "::error::JFrog copy to public-releases failed with HTTP ${HTTP_STATUS}"
exit 1
fi
- name: Create GitHub release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.version.outputs.next }}
body_path: build/release-notes.md