From 60c43a151d6b739654b5def839cb66d61e9e0689 Mon Sep 17 00:00:00 2001 From: Arian Flores Date: Wed, 4 Jan 2023 19:50:04 -0800 Subject: [PATCH 1/4] Yarn install with --frozen-lockfile to prevent dirty directory --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 415283528..070e32298 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -49,4 +49,5 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | yarn build + yarn install --frozen-lockfile --non-interactive --cache-folder=~/.cache/yarn yarn auto shipit From b08c8b3e6a02296ee61bf64a0e27a5e6faaa4ff7 Mon Sep 17 00:00:00 2001 From: Madison Grubb Date: Thu, 5 Jan 2023 12:44:39 -0500 Subject: [PATCH 2/4] explicitly set immutable for installation. move env vars to top of workflow config --- .github/workflows/publish.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 070e32298..4337c1095 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,11 @@ on: branches: - "master" +env: + GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} + GH_TOKEN: ${{ secrets.ADMIN_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + jobs: publish: runs-on: ubuntu-20.04 @@ -22,13 +27,12 @@ jobs: with: node-version: 16 cache: 'yarn' - - run: | + - name: Install dependencies + run: | yarn -v - yarn + yarn install --immutable - name: Apply semver updates (if any) - env: - GH_TOKEN: ${{ secrets.ADMIN_TOKEN }} run: | if yarn auto version; then AUTO_VERSION=$(yarn auto version) @@ -43,11 +47,7 @@ jobs: fi - name: Create Release - env: - GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} - GH_TOKEN: ${{ secrets.ADMIN_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | + yarn install --immutable yarn build - yarn install --frozen-lockfile --non-interactive --cache-folder=~/.cache/yarn - yarn auto shipit + yarn auto shipit -vv From 2707d6c408a08d282f46adbd3c76c84d2f78829f Mon Sep 17 00:00:00 2001 From: Madison Grubb Date: Thu, 5 Jan 2023 13:05:53 -0500 Subject: [PATCH 3/4] remove yarn install from build and publish step --- .github/workflows/publish.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4337c1095..b29bc3488 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,8 +19,8 @@ jobs: with: token: ${{ secrets.ADMIN_TOKEN }} - - name: Prepare repository - run: git fetch --unshallow --tags + # - name: Prepare repository + # run: git fetch --unshallow --tags - name: Setup node uses: actions/setup-node@v3 @@ -48,6 +48,5 @@ jobs: - name: Create Release run: | - yarn install --immutable yarn build - yarn auto shipit -vv + yarn auto shipit -d -vv From 11df0d482ed3873767de0a7e6760d6b3fee33e9e Mon Sep 17 00:00:00 2001 From: Madison Grubb Date: Thu, 5 Jan 2023 14:00:01 -0500 Subject: [PATCH 4/4] add separate jobs for build and publish. --- .github/workflows/publish.yml | 45 +++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b29bc3488..659d9eb1a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,17 +10,17 @@ env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} jobs: - publish: + build: runs-on: ubuntu-20.04 - name: Publish + name: Build if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" steps: - uses: actions/checkout@v3 with: token: ${{ secrets.ADMIN_TOKEN }} - # - name: Prepare repository - # run: git fetch --unshallow --tags + - name: Prepare repository + run: git fetch --unshallow --tags - name: Setup node uses: actions/setup-node@v3 @@ -45,8 +45,39 @@ jobs: else echo "Unable to bump version successfully." && exit 1 fi + - name: Build + run: yarn build + - name: Upload Build Results + uses: actions/upload-artifact@v3 + with: + name: build-output + path: | + packages/@magic-ext/*/dist + packages/@magic-sdk/*/dist + packages/*/dist + + publish: + runs-on: ubuntu-20.04 + name: Publish + needs: build + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.ADMIN_TOKEN }} + + - name: Prepare repository + run: git fetch --unshallow --tags + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'yarn' + + - name: Download Build Results + uses: actions/download-artifact@v3 + with: + name: build-output - name: Create Release - run: | - yarn build - yarn auto shipit -d -vv + run: yarn auto shipit -vv