Skip to content

Commit

Permalink
fix: remove test code from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Apr 9, 2024
1 parent 2aa96be commit a42c701
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 63 deletions.
69 changes: 7 additions & 62 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
run: yarn test:spec

- name: Upload binding.node
if: github.repository_owner == 'chainsafe' && github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: binding-${{ matrix.os }}-${{ matrix.node }}
Expand All @@ -101,10 +102,10 @@ jobs:
fail-fast: false
matrix:
node:
# - 16
# - 18
- 16
- 18
- 20
# - 21
- 21
runs-on: ubuntu-22.04
defaults:
run:
Expand Down Expand Up @@ -137,6 +138,7 @@ jobs:
docker cp temp-container:/usr/src/blst-ts/prebuild ./prebuild
- name: Upload binding.node
if: github.repository_owner == 'chainsafe' && github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: binding-linux-arm-${{ matrix.node }}
Expand All @@ -162,66 +164,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-download:
needs: ["build", "build-arm"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v4
with:
node-version: ${{env.NPM_PREBUILT_NODE_VERSION}}
registry-url: "https://registry.npmjs.org"

- name: Create tag
id: tag
uses: butlerlogic/action-autotag@1.1.2
with:
strategy: package
tag_prefix: "v"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get pre-built binding.node files
uses: actions/download-artifact@v4
with:
path: prebuild/
merge-multiple: true

- name: Install
run: yarn

- name: Build TS
run: yarn build:ts

# Moves all prebuilds to the `release` folder and then only moves the
# prebuilds for the current node version into the `prebuild` folder for
# publishing to npm. Goal is to reduce bundle size and to also provide
# faster install time for the most common version that Lodestar is supporting
- name: Prepare for Release and Publishing
run: yarn ts-node scripts/makeRelease

- name: List files in ROOT/
run: ls -R .

- name: List files in prebuild/
run: ls -R prebuild

- name: List files in release/
run: ls -R release

- name: Exit if no version change
if: steps.tag.outputs.tagcreated == 'no'
uses: actions/github-script@v3
with:
script: core.setFailed('The package.json version did not change. Workflow will not create a release.')


publish:
needs: ["build", "build-arm"]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -278,7 +223,7 @@ jobs:
if: steps.tag.outputs.tagcreated == 'yes'
uses: softprops/action-gh-release@v2
with:
files: release/*.node
files: release/*
tag_name: ${{ steps.tag.outputs.tagname }}
fail_on_unmatched_files: true
env:
Expand Down
3 changes: 2 additions & 1 deletion scripts/makeRelease.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {resolve} from "path";
import {cpSync, readdirSync, rmSync} from "fs";
import {mkdirSync, cpSync, readdirSync, rmSync} from "fs";
import {BINDINGS_FILE} from "../utils";

const RELEASE_FOLDER = resolve(__dirname, "..", "release");
const PREBUILD_FOLDER = resolve(__dirname, "..", "prebuild");

mkdirSync(RELEASE_FOLDER);
/**
* Reads through the files in the PREBUILD_FOLDER. Copies all to the
* RELEASE_FOLDER and then deletes the ones that are not slated for publishing
Expand Down

0 comments on commit a42c701

Please sign in to comment.