Skip to content

Commit 42e8f0b

Browse files
authored
Merge pull request #796 from immutable/chore/bump-audience-0.4.0
chore: bump audience to 0.4.0
2 parents 6b4937f + 699ea59 commit 42e8f0b

4 files changed

Lines changed: 75 additions & 5 deletions

File tree

.github/workflows/label-pr.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,31 @@ jobs:
1919
with:
2020
repo-token: ${{ secrets.GITHUB_TOKEN }}
2121
configuration-path: .github/pr-labeler/config.yml
22+
23+
- uses: actions/github-script@v6
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
script: |
27+
const files = await github.rest.pulls.listFiles({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
pull_number: context.payload.pull_request.number,
31+
})
32+
const isAudience = files.data.some(f =>
33+
f.filename.startsWith('src/Packages/Audience/')
34+
)
35+
if (!isAudience) return
36+
37+
const branch = context.payload.pull_request.head.ref
38+
let label = 'audience-chore'
39+
if (branch.startsWith('feat/')) label = 'audience-feature'
40+
else if (branch.startsWith('fix/')) label = 'audience-fix'
41+
else if (branch.startsWith('perf/')) label = 'audience-performance'
42+
else if (branch.startsWith('docs/')) label = 'audience-docs'
43+
44+
await github.rest.issues.addLabels({
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
issue_number: context.payload.pull_request.number,
48+
labels: [label],
49+
})

.github/workflows/release.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ jobs:
2626
echo "LATEST_TAG=${LATEST_TAG}" >> "$GITHUB_ENV"
2727
if [[ "$LATEST_TAG" == audience/* ]]; then
2828
echo "IS_AUDIENCE=true" >> "$GITHUB_ENV"
29+
PREV_TAG="$(git tag --sort=-creatordate | grep "^audience/" | sed -n '2p')"
2930
else
3031
echo "IS_AUDIENCE=false" >> "$GITHUB_ENV"
32+
PREV_TAG="$(git tag --sort=-creatordate | grep -v "^audience/" | sed -n '2p')"
3133
fi
34+
echo "PREV_TAG=${PREV_TAG}" >> "$GITHUB_ENV"
3235
if [[ "$LATEST_TAG" == *alpha* ]]; then
3336
echo "IS_PRERELEASE=true" >> "$GITHUB_ENV"
3437
else
@@ -38,12 +41,51 @@ jobs:
3841
- name: Pull LFS
3942
run: git lfs pull
4043

41-
- name: Build Changelog
42-
id: github_release
44+
- name: Build Changelog (Audience)
45+
id: github_release_audience
46+
if: env.IS_AUDIENCE == 'true'
4347
uses: mikepenz/release-changelog-builder-action@v3
4448
env:
4549
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4650
with:
51+
fromTag: ${{ env.PREV_TAG }}
52+
toTag: ${{ env.LATEST_TAG }}
53+
configurationJson: |
54+
{
55+
"pr_template": "- #{{TITLE}} (##{{NUMBER}})",
56+
"categories": [
57+
{
58+
"title": "## Features",
59+
"labels": ["audience-feature"]
60+
},
61+
{
62+
"title": "## Fixes",
63+
"labels": ["audience-fix"]
64+
},
65+
{
66+
"title": "## Performance",
67+
"labels": ["audience-performance"]
68+
},
69+
{
70+
"title": "## Documentation",
71+
"labels": ["audience-docs"]
72+
},
73+
{
74+
"title": "## Chores",
75+
"labels": ["audience-chore"]
76+
}
77+
]
78+
}
79+
80+
- name: Build Changelog (Passport)
81+
id: github_release_passport
82+
if: env.IS_AUDIENCE != 'true'
83+
uses: mikepenz/release-changelog-builder-action@v3
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
fromTag: ${{ env.PREV_TAG }}
88+
toTag: ${{ env.LATEST_TAG }}
4789
configurationJson: |
4890
{
4991
"pr_template": "- #{{TITLE}} (##{{NUMBER}})",
@@ -103,7 +145,7 @@ jobs:
103145
tag_name: ${{ env.LATEST_TAG }}
104146
release_name: ${{ env.LATEST_TAG }}
105147
body: |
106-
${{steps.github_release.outputs.changelog}}
148+
${{steps.github_release_audience.outputs.changelog}}${{steps.github_release_passport.outputs.changelog}}
107149
108150
${{ env.RELEASE_BODY_SUFFIX }}
109151
draft: false

src/Packages/Audience/Runtime/Core/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal static class Constants
1818
internal const int ControlPlaneRequestTimeoutSeconds = 30;
1919

2020
internal const string LibraryName = "com.immutable.audience";
21-
internal const string LibraryVersion = "0.3.1";
21+
internal const string LibraryVersion = "0.4.0";
2222
internal const string Surface = "unity";
2323
internal const string ConsentSource = "UnitySDK";
2424

src/Packages/Audience/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.immutable.audience",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "Immutable Audience SDK for Unity.",
55
"displayName": "Immutable Audience",
66
"author": {

0 commit comments

Comments
 (0)