Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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],
})
48 changes: 45 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}})",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Packages/Audience/Runtime/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/Packages/Audience/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Loading