Skip to content

Commit

Permalink
Fix release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Apr 25, 2024
1 parent 8acba03 commit eb85da3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/release.yml
Expand Up @@ -9,10 +9,33 @@ permissions:
contents: read

jobs:
release-notes:
check_branch:
runs-on: ubuntu-latest
outputs:
should_build: ${{ steps.permitted.outputs.result }}

if: github.repository_owner == 'visgl' && (github.ref == 'refs/heads/master' || endsWith(github.ref, '-release'))
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Fetch remote branches
run: |
git fetch origin --depth=1
- name: Check if on permitted branch
id: permitted
run: |
result=
branchName=$(git branch -a --contains $GITHUB_SHA | grep 'remotes/origin/' || echo "")
if [[ $branchName == *"master" || $branchName == *"-release" ]]; then
result=true
fi
echo "result=${result}" >> "$GITHUB_OUTPUT"
release:
runs-on: ubuntu-latest
needs: check_branch

if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_build }}

env:
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
Expand All @@ -21,9 +44,6 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get git tags (https://github.com/actions/checkout/issues/206)
run: git fetch --tags -f

- name: Use Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -54,7 +54,7 @@
"@math.gl/proj4": "^4.0.0",
"@probe.gl/bench": "^4.0.9",
"jsdom": "^20.0.0",
"ocular-dev-tools": "2.0.0-alpha.30",
"ocular-dev-tools": "2.0.0-alpha.33",
"pre-commit": "^1.2.2",
"pre-push": "^0.1.1",
"puppeteer": "^22.4.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/github-release.js
Expand Up @@ -28,7 +28,7 @@ console.log(JSON.stringify(requestBody));

function getGitTag() {
try {
return execSync('git describe --exact-match HEAD', {
return execSync('git describe --tags --exact-match HEAD', {
stdio: [null, 'pipe', null],
encoding: 'utf-8'
}).trim();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -8857,10 +8857,10 @@ object.values@^1.1.7:
define-properties "^1.2.0"
es-abstract "^1.22.1"

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

0 comments on commit eb85da3

Please sign in to comment.