diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index b5bfce37..8a59da0c 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -19,3 +19,31 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/pr-labeler/config.yml + + - uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const files = await github.rest.pulls.listFiles({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + const isAudience = files.data.some(f => + f.filename.startsWith('src/Packages/Audience/') + ) + if (!isAudience) return + + const branch = context.payload.pull_request.head.ref + let label = 'audience-chore' + if (branch.startsWith('feat/')) label = 'audience-feature' + else if (branch.startsWith('fix/')) label = 'audience-fix' + else if (branch.startsWith('perf/')) label = 'audience-performance' + else if (branch.startsWith('docs/')) label = 'audience-docs' + + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: [label], + }) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 618188c7..f171de2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,9 +26,12 @@ jobs: echo "LATEST_TAG=${LATEST_TAG}" >> "$GITHUB_ENV" if [[ "$LATEST_TAG" == audience/* ]]; then echo "IS_AUDIENCE=true" >> "$GITHUB_ENV" + PREV_TAG="$(git tag --sort=-creatordate | grep "^audience/" | sed -n '2p')" else echo "IS_AUDIENCE=false" >> "$GITHUB_ENV" + PREV_TAG="$(git tag --sort=-creatordate | grep -v "^audience/" | sed -n '2p')" fi + echo "PREV_TAG=${PREV_TAG}" >> "$GITHUB_ENV" if [[ "$LATEST_TAG" == *alpha* ]]; then echo "IS_PRERELEASE=true" >> "$GITHUB_ENV" else @@ -38,12 +41,51 @@ jobs: - name: Pull LFS run: git lfs pull - - name: Build Changelog - id: github_release + - name: Build Changelog (Audience) + id: github_release_audience + if: env.IS_AUDIENCE == 'true' uses: mikepenz/release-changelog-builder-action@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + fromTag: ${{ env.PREV_TAG }} + toTag: ${{ env.LATEST_TAG }} + configurationJson: | + { + "pr_template": "- #{{TITLE}} (##{{NUMBER}})", + "categories": [ + { + "title": "## Features", + "labels": ["audience-feature"] + }, + { + "title": "## Fixes", + "labels": ["audience-fix"] + }, + { + "title": "## Performance", + "labels": ["audience-performance"] + }, + { + "title": "## Documentation", + "labels": ["audience-docs"] + }, + { + "title": "## Chores", + "labels": ["audience-chore"] + } + ] + } + + - name: Build Changelog (Passport) + id: github_release_passport + if: env.IS_AUDIENCE != 'true' + uses: mikepenz/release-changelog-builder-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + fromTag: ${{ env.PREV_TAG }} + toTag: ${{ env.LATEST_TAG }} configurationJson: | { "pr_template": "- #{{TITLE}} (##{{NUMBER}})", @@ -103,7 +145,7 @@ jobs: tag_name: ${{ env.LATEST_TAG }} release_name: ${{ env.LATEST_TAG }} body: | - ${{steps.github_release.outputs.changelog}} + ${{steps.github_release_audience.outputs.changelog}}${{steps.github_release_passport.outputs.changelog}} ${{ env.RELEASE_BODY_SUFFIX }} draft: false diff --git a/src/Packages/Audience/Runtime/Core/Constants.cs b/src/Packages/Audience/Runtime/Core/Constants.cs index faed929d..3645dd06 100644 --- a/src/Packages/Audience/Runtime/Core/Constants.cs +++ b/src/Packages/Audience/Runtime/Core/Constants.cs @@ -18,7 +18,7 @@ internal static class Constants internal const int ControlPlaneRequestTimeoutSeconds = 30; internal const string LibraryName = "com.immutable.audience"; - internal const string LibraryVersion = "0.3.1"; + internal const string LibraryVersion = "0.4.0"; internal const string Surface = "unity"; internal const string ConsentSource = "UnitySDK"; diff --git a/src/Packages/Audience/package.json b/src/Packages/Audience/package.json index 5943dd30..fc1b5e40 100644 --- a/src/Packages/Audience/package.json +++ b/src/Packages/Audience/package.json @@ -1,6 +1,6 @@ { "name": "com.immutable.audience", - "version": "0.3.1", + "version": "0.4.0", "description": "Immutable Audience SDK for Unity.", "displayName": "Immutable Audience", "author": {