newspack-scripts 5.9.0 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,9 @@ name: i18n
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
workflow_call:
|
|
5
|
+
secrets:
|
|
6
|
+
GIT_COMMITTER_TOKEN:
|
|
7
|
+
required: true
|
|
5
8
|
|
|
6
9
|
permissions:
|
|
7
10
|
contents: write
|
|
@@ -15,6 +18,15 @@ jobs:
|
|
|
15
18
|
uses: actions/checkout@v4
|
|
16
19
|
with:
|
|
17
20
|
fetch-depth: 0
|
|
21
|
+
token: ${{ secrets.GIT_COMMITTER_TOKEN }}
|
|
22
|
+
|
|
23
|
+
- name: Configure Git
|
|
24
|
+
env:
|
|
25
|
+
GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME || 'github-actions[bot]' }}
|
|
26
|
+
GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL || 'github-actions[bot]@users.noreply.github.com' }}
|
|
27
|
+
run: |
|
|
28
|
+
git config user.name "$GIT_COMMITTER_NAME"
|
|
29
|
+
git config user.email "$GIT_COMMITTER_EMAIL"
|
|
18
30
|
|
|
19
31
|
- name: Setup Node.js
|
|
20
32
|
uses: actions/setup-node@v4
|
|
@@ -105,11 +117,6 @@ jobs:
|
|
|
105
117
|
|
|
106
118
|
- name: Commit translation files
|
|
107
119
|
if: steps.check-bot.outputs.skip != 'true'
|
|
108
|
-
env:
|
|
109
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
110
|
-
REPO_NAME: ${{ github.event.repository.name }}
|
|
111
|
-
GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME || 'github-actions[bot]' }}
|
|
112
|
-
GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL || 'github-actions[bot]@users.noreply.github.com' }}
|
|
113
120
|
run: |
|
|
114
121
|
if [ "$REPO_NAME" = "newspack-theme" ]; then
|
|
115
122
|
cd ./newspack-theme
|
|
@@ -126,11 +133,7 @@ jobs:
|
|
|
126
133
|
LINES_CHANGED=${LINES_CHANGED:-0}
|
|
127
134
|
echo "Lines changed in languages/: $LINES_CHANGED"
|
|
128
135
|
if [ "$LINES_CHANGED" -gt 3 ]; then
|
|
129
|
-
git config user.email "$GIT_COMMITTER_EMAIL"
|
|
130
|
-
git config user.name "$GIT_COMMITTER_NAME"
|
|
131
|
-
git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/${{ github.repository }}.git
|
|
132
136
|
git add languages/
|
|
133
137
|
git commit -m "chore: update translation files [skip ci]"
|
|
134
|
-
git
|
|
135
|
-
git push origin ${{ github.ref_name }}
|
|
138
|
+
git push
|
|
136
139
|
fi
|
|
@@ -6,6 +6,8 @@ permissions:
|
|
|
6
6
|
on:
|
|
7
7
|
workflow_call:
|
|
8
8
|
secrets:
|
|
9
|
+
GIT_COMMITTER_TOKEN:
|
|
10
|
+
required: true
|
|
9
11
|
SLACK_CHANNEL_ID:
|
|
10
12
|
required: false
|
|
11
13
|
SLACK_AUTH_TOKEN:
|
|
@@ -20,6 +22,15 @@ jobs:
|
|
|
20
22
|
uses: actions/checkout@v4
|
|
21
23
|
with:
|
|
22
24
|
fetch-depth: 0
|
|
25
|
+
token: ${{ secrets.GIT_COMMITTER_TOKEN }}
|
|
26
|
+
|
|
27
|
+
- name: Configure Git
|
|
28
|
+
env:
|
|
29
|
+
GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME || 'github-actions[bot]' }}
|
|
30
|
+
GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL || 'github-actions[bot]@users.noreply.github.com' }}
|
|
31
|
+
run: |
|
|
32
|
+
git config user.name "$GIT_COMMITTER_NAME"
|
|
33
|
+
git config user.email "$GIT_COMMITTER_EMAIL"
|
|
23
34
|
|
|
24
35
|
- name: Setup Node.js
|
|
25
36
|
uses: actions/setup-node@v4
|
|
@@ -32,10 +43,6 @@ jobs:
|
|
|
32
43
|
|
|
33
44
|
- name: Perform post-release chores
|
|
34
45
|
env:
|
|
35
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
-
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
37
|
-
GIT_COMMITTER_NAME: github-actions[bot]
|
|
38
|
-
GITHUB_COMMITER_EMAIL: github-actions[bot]@users.noreply.github.com
|
|
39
46
|
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
|
|
40
47
|
SLACK_AUTH_TOKEN: ${{ secrets.SLACK_AUTH_TOKEN }}
|
|
41
48
|
run: ./node_modules/newspack-scripts/scripts/github/post-release.sh
|
|
@@ -51,11 +51,3 @@ jobs:
|
|
|
51
51
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
52
52
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
53
53
|
run: npm run release
|
|
54
|
-
|
|
55
|
-
- name: Upload release artifacts
|
|
56
|
-
uses: actions/upload-artifact@v4
|
|
57
|
-
with:
|
|
58
|
-
name: release-artifacts
|
|
59
|
-
path: release/
|
|
60
|
-
if-no-files-found: ignore
|
|
61
|
-
retention-days: 1
|
package/package.json
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# This script should be ran on CI after a new regular (not pre-release) version is released.
|
|
4
4
|
|
|
5
|
-
git config user.name "$GIT_COMMITTER_NAME"
|
|
6
|
-
git config user.email "$GITHUB_COMMITER_EMAIL"
|
|
7
|
-
|
|
8
5
|
# The last commit message at this point is the automated release commit. The second-to-last
|
|
9
6
|
# commit message should contain data about the merge.
|
|
10
7
|
SECOND_TO_LAST_COMMIT_MSG=$(git log -n 1 --skip 1 --pretty=format:"%s")
|
|
@@ -23,13 +20,13 @@ if [[ $(echo $SECOND_TO_LAST_COMMIT_MSG | grep '^Merge .*alpha') ]]; then
|
|
|
23
20
|
# we don't care about any alpha changes.
|
|
24
21
|
git reset --hard release --
|
|
25
22
|
# Force-push the alpha branch.
|
|
26
|
-
git push
|
|
23
|
+
git push --force
|
|
27
24
|
else
|
|
28
25
|
echo '[newspack-scripts] Release was created from a different branch than the alpha branch (e.g. a hotfix branch).'
|
|
29
26
|
echo '[newspack-scripts] Alpha branch will now be updated with the lastest changes from release.'
|
|
30
27
|
git merge --no-ff release -m "chore(release): merge in release $LATEST_VERSION_TAG"
|
|
31
28
|
if [[ $? == 0 ]]; then
|
|
32
|
-
git push
|
|
29
|
+
git push
|
|
33
30
|
else
|
|
34
31
|
git merge --abort
|
|
35
32
|
echo '[newspack-scripts] Post-release merge to alpha failed.'
|
|
@@ -55,7 +52,7 @@ git checkout trunk
|
|
|
55
52
|
git merge --no-ff release -m "chore(release): merge in release $LATEST_VERSION_TAG"
|
|
56
53
|
if [[ $? == 0 ]]; then
|
|
57
54
|
echo '[newspack-scripts] Pushing updated trunk to origin.'
|
|
58
|
-
git push
|
|
55
|
+
git push
|
|
59
56
|
else
|
|
60
57
|
git merge --abort
|
|
61
58
|
echo '[newspack-scripts] Post-release merge to trunk failed.'
|