Release 1.9.4 #27
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: Publish release | |
on: | |
# Runs whenever a release PR is merged | |
pull_request: | |
branches: | |
- main | |
types: [ closed ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# Publish job | |
publish: | |
# Run only for "release/x.y.z" PRs, and only when the PR is merged (not abandoned) | |
if: ${{ !github.event.pull_request || (startsWith(github.head_ref, 'release/') && github.event.pull_request.merged) }} | |
runs-on: ubuntu-latest | |
# Sets permissions of the GITHUB_TOKEN to allow publishing to GitHub Packages | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
steps: | |
- name: Create app token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ vars.THEOPLAYER_BOT_APP_ID }} | |
private-key: ${{ secrets.THEOPLAYER_BOT_PRIVATE_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.app-token.outputs.token }} | |
- name: Configure Git user | |
run: | | |
git config user.name 'theoplayer-bot[bot]' | |
git config user.email '873105+theoplayer-bot[bot]@users.noreply.github.com' | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Validate Gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Publish package | |
run: ./gradlew publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPOSILITE_USERNAME: ${{ secrets.REPOSILITE_USERNAME }} | |
REPOSILITE_PASSWORD: ${{ secrets.REPOSILITE_PASSWORD }} | |
- name: Get version | |
shell: bash | |
run: | | |
echo "version=$(./gradlew :ui:properties --no-daemon --console=plain --quiet | awk '/^version:/ {print $2}')" >> "$GITHUB_ENV" | |
- name: Push tag | |
run: | | |
git tag "v$version" -m "$version" | |
git push origin "v$version" | |
- name: Create GitHub release | |
run: | | |
gh release create "v$version" --verify-tag --latest \ | |
--title "$version" \ | |
--notes "$(node ./scripts/github_changelog.js $version)" | |
env: | |
GH_TOKEN: ${{ steps.app-token.outputs.token }} |