[ETHEREUM-CONTRACTS] overhaul of SuperTokenV1Library & legacy lib deprecation #5602
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | Create PR Artifact | |
on: | |
pull_request: | |
types: [opened, reopened, ready_for_review, synchronize] | |
jobs: | |
create_pr_artifact: | |
name: Create PR Artifact | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: nix develop .#ci-default -c bash -xe {0} | |
if: ${{ !github.event.pull_request.draft }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v13 | |
- name: Show context | |
env: | |
HEAD_REF: ${{ github.head_ref }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
echo github.event_name: ${{ github.event_name }} | |
echo github.event.number: ${{ github.event.number }} | |
echo github.sha: ${{ github.sha }} | |
echo github.repository: ${{ github.repository }} | |
echo github.ref: "$GITHUB_REF" | |
echo github.head_ref: "$HEAD_REF" | |
echo github.base_ref: ${{ github.base_ref }} | |
echo "github.event.pull_request" | |
echo " .number" ${{ github.event.pull_request.number }} | |
echo " .state" ${{ github.event.pull_request.state }} | |
echo " .locked" ${{ github.event.pull_request.locked }} | |
echo " .draft" ${{ github.event.pull_request.draft }} | |
- name: Create build set | |
run: tasks/create-build-set.sh ${{ github.sha }} dev origin | |
- name: Install dependencies | |
if: env.PUBLISH_PR_ARTIFACT == 1 | |
run: yarn install --frozen-lockfile | |
- name: Build | |
if: env.PUBLISH_PR_ARTIFACT == 1 | |
run: yarn build | |
- name: Setup PR package versions locally | |
if: env.PUBLISH_PR_ARTIFACT == 1 | |
run: | | |
prNumber=${{ github.event.number }} | |
shortRev=$(git rev-parse --short ${{ github.sha }}) | |
preId=PR${prNumber}.${shortRev} | |
yarn lerna version prerelease --yes --no-git-tag-version --preid "${preId}" | |
- name: Create packages | |
if: env.PUBLISH_PR_ARTIFACT == 1 | |
run: | | |
prNumber=${{ github.event.number }} | |
dirName="bin/${prNumber}" | |
mkdir -p $dirName | |
for d in packages/ethereum-contracts packages/sdk-core packages/sdk-redux; do ( | |
cd "$d" | |
tgz=$(npm pack) | |
cp "$tgz" "../../$dirName/" | |
) done | |
cd "$dirName" | |
sha="${{ github.event.pull_request.head.sha }}" | |
for f in * ; do | |
mv -- "$f" "${f%.tgz}-${sha:0:7}.tgz" | |
done | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pr-packages | |
path: bin | |
retention-days: 1 | |
if-no-files-found: warn |