Skip to content

Commit eb85da3

Browse files
committed
Fix release CI
1 parent 8acba03 commit eb85da3

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,33 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
release-notes:
12+
check_branch:
1313
runs-on: ubuntu-latest
14+
outputs:
15+
should_build: ${{ steps.permitted.outputs.result }}
1416

15-
if: github.repository_owner == 'visgl' && (github.ref == 'refs/heads/master' || endsWith(github.ref, '-release'))
17+
steps:
18+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19+
20+
- name: Fetch remote branches
21+
run: |
22+
git fetch origin --depth=1
23+
24+
- name: Check if on permitted branch
25+
id: permitted
26+
run: |
27+
result=
28+
branchName=$(git branch -a --contains $GITHUB_SHA | grep 'remotes/origin/' || echo "")
29+
if [[ $branchName == *"master" || $branchName == *"-release" ]]; then
30+
result=true
31+
fi
32+
echo "result=${result}" >> "$GITHUB_OUTPUT"
33+
34+
release:
35+
runs-on: ubuntu-latest
36+
needs: check_branch
37+
38+
if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_build }}
1639

1740
env:
1841
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
@@ -21,9 +44,6 @@ jobs:
2144
steps:
2245
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2346

24-
- name: Get git tags (https://github.com/actions/checkout/issues/206)
25-
run: git fetch --tags -f
26-
2747
- name: Use Node.js
2848
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
2949
with:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@math.gl/proj4": "^4.0.0",
5555
"@probe.gl/bench": "^4.0.9",
5656
"jsdom": "^20.0.0",
57-
"ocular-dev-tools": "2.0.0-alpha.30",
57+
"ocular-dev-tools": "2.0.0-alpha.33",
5858
"pre-commit": "^1.2.2",
5959
"pre-push": "^0.1.1",
6060
"puppeteer": "^22.4.0",

scripts/github-release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ console.log(JSON.stringify(requestBody));
2828

2929
function getGitTag() {
3030
try {
31-
return execSync('git describe --exact-match HEAD', {
31+
return execSync('git describe --tags --exact-match HEAD', {
3232
stdio: [null, 'pipe', null],
3333
encoding: 'utf-8'
3434
}).trim();

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8857,10 +8857,10 @@ object.values@^1.1.7:
88578857
define-properties "^1.2.0"
88588858
es-abstract "^1.22.1"
88598859

8860-
8861-
version "2.0.0-alpha.30"
8862-
resolved "https://registry.yarnpkg.com/ocular-dev-tools/-/ocular-dev-tools-2.0.0-alpha.30.tgz#68f6928142ae5526267988c9ab297e2002194772"
8863-
integrity sha512-Kz/mRzI6OHX8ljMZTaal2+iwJGVLzfojiP4l0LgptNCu6vEyV48eVTBD4+rWOrD/uCTCLATKFhBytkMONWK41A==
8860+
8861+
version "2.0.0-alpha.33"
8862+
resolved "https://registry.yarnpkg.com/ocular-dev-tools/-/ocular-dev-tools-2.0.0-alpha.33.tgz#c17da68040adfc5cff8e5033d7f0f2afea05d0f7"
8863+
integrity sha512-VhEtuT49d94IpV3IqQti21bX0aULhw8a4Pxw765K9axxM07WbgM1be1flcLxgBXZ4qHUy7pzmiuPmZOgkcc5uQ==
88648864
dependencies:
88658865
"@babel/cli" "^7.14.5"
88668866
"@babel/core" "^7.14.5"

0 commit comments

Comments
 (0)