Skip to content

Commit ffed058

Browse files
chore: update semantic-release config
1 parent cc738f0 commit ffed058

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

.github/workflows/deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323

2424
- run: make install
2525
- run: make compile
26-
- name: Publish to npm
26+
- name: Semantic Release
2727
run: npx semantic-release
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3131

3232
- name: Post-release sync
3333
run: ./utils/ci/sync.sh
34-
if: success() && endsWith(github.ref, 'release')
34+
if: success()

makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ pristine: distclean
8585
rm -rf node_modules
8686

8787
release/latest:
88-
utils/make/release.sh release
88+
utils/make/release.sh release/latest
8989

9090
release/next:
91-
utils/make/release.sh release/next noclean
91+
utils/make/release.sh release/next
9292

9393
.PHONY: force
9494

release.config.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ module.exports = {
44
// eslint-disable-next-line no-template-curly-in-string
55
tagFormat: '${version}',
66
branches: [
7-
// TODO: Ideally the default release branch would be release/latest
8-
// but semantic-release refuses to work with a default branch with a slash, apparently 🤷‍♂️
9-
{ name: 'release' },
10-
{ name: 'release/next', channel: 'next', prerelease: 'beta' },
7+
{ name: 'release/latest', channel: 'latest' },
8+
{ name: 'release/next', channel: 'next', prerelease: 'alpha' },
119
],
1210

1311
plugins: [

utils/ci/sync.sh

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
set -o errexit
44

5+
head=$(git rev-parse --abbrev-ref HEAD)
6+
57
printf "\n=====>\tFetching new commits...\n"
68

79
# Ensure we are merging the release into current branch tips to avoid pushes being rejected
810
git fetch origin
911

10-
printf "\n=====>\tMerging to master...\n"
12+
printf "\n=====>\tMerging to master: %s...\n" "${head}"
1113

1214
git checkout master
13-
git merge release
15+
git merge "${head}"
1416

1517
# Print the repo status after merging, for troubleshooting purposes
1618
git status
@@ -19,6 +21,3 @@ git log --oneline HEAD~10..HEAD
1921
printf "\n=====>\tPushing...\n"
2022

2123
git push origin master
22-
23-
printf "\n=====>\tCleaning up...\n"
24-
git push origin :release

utils/make/release.sh

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#!/bin/sh
22

33
branch="$1"
4-
noclean="$2"
54

65
set -o errexit
76

87
head=$(git rev-parse --abbrev-ref HEAD)
98

10-
printf "\n=====>\tCreating release branch: %s...\n" "${branch}"
9+
printf "\n=====>\tChecking out release branch: %s...\n" "${branch}"
1110

1211
git checkout -B "${branch}"
1312

13+
printf "\n=====>\tMerging %s...\n" "${head}"
14+
15+
git merge --message "chore: release" "${head}"
16+
1417
printf "\n=====>\tPushing...\n"
1518

1619
git push --set-upstream origin "${branch}"
@@ -19,10 +22,4 @@ printf "\n=====>\tSwitching back to previous branch: %s...\n" "${head}"
1922

2023
git checkout "${head}"
2124

22-
if [ "${noclean}" != "noclean" ]; then
23-
printf "\n=====>\tDeleting local release branch: %s...\n" "${branch}"
24-
25-
git branch --delete "${branch}"
26-
fi
27-
2825
printf "\n=====>\tRelease in progress: https://github.com/strvcom/heimdall/actions\n"

0 commit comments

Comments
 (0)