From e5eaa096a08e4ec3ce8977902453af4c1d1c0728 Mon Sep 17 00:00:00 2001 From: Artur Finger Date: Mon, 20 Nov 2023 15:08:37 +0200 Subject: [PATCH] jobs depend on each other --- .github/workflows/publish.yml | 62 ++++++++++------------------------- 1 file changed, 17 insertions(+), 45 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d31a39..26852cc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,11 +12,10 @@ env: VERSION: 0.7.7 jobs: - publish-to-npm: - name: Publish to NPM - runs-on: [ubuntu-latest] + setup: + name: Setup steps: - - name: Checkout + - name: Checkout Code uses: actions/checkout@v3 - name: Setup Node @@ -25,6 +24,14 @@ jobs: node-version: 16 cache: npm + - name: Install dependencies + run: npm ci + + publish-to-npm: + name: Publish to NPM + runs-on: [ubuntu-latest] + needs: [setup] + steps: - name: Write NPM RC run: | echo '@castlabs:registry=https://registry.npmjs.org' > .npmrc @@ -33,16 +40,6 @@ jobs: - name: Set Package Version run: npm --no-git-tag-version --allow-same-version version ${{ env.VERSION }} - # TODO remove this debug - - name: Debug Echo Version - run: echo ${{ env.VERSION }} - # TODO remove this debug - - name: Debug Cat package.json - run: cat package.json - - - name: Install dependencies - run: npm ci - - name: Build run: npm run build @@ -55,39 +52,11 @@ jobs: echo '### NPM Release' >> $GITHUB_STEP_SUMMARY echo "Released version ${{ env.VERSION }} of https://www.npmjs.com/package/@castlabs/prestoplay-react-components" >> $GITHUB_STEP_SUMMARY - publish-api-docs: name: Publish API Docs runs-on: [ubuntu-latest] + needs: [setup] steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: npm - - # TODO remove this debug - - name: Debug Echo Version - run: echo ${{ env.VERSION }} - - # - name: Debug pwd - # run: pwd - - # - name: Debug CAT package.json - # run: cat package.json - - # - name: Debug Lint - # run: npm run lint - - # - name: Debug Storybook help - # run: npm run storybook-help - - - name: Install dependencies - run: npm ci - - name: Build Storybook run: npm run build-storybook @@ -105,11 +74,14 @@ jobs: # role-to-assume: arn:aws:iam::068037490145:role/prestoplay-web-web-uploader # aws-region: us-east-1 - - # Is there a dry run? Let's perhaps try version 0.0.1 # - name: Upload to S3 # run: aws s3 cp --recursive “./dist/storybook "s3://players-castlabs-com-root/react-dom/${{ env.VERSION }}/" # Let’s keep the default cache policy which is 1 day # This will publish to https://players.castlabs.com/react-dom (I hope) + + # - name: Job Summary + # run: | + # echo '### NPM Release' >> $GITHUB_STEP_SUMMARY + # echo "Released version ${{ env.VERSION }} of https://www.npmjs.com/package/@castlabs/prestoplay-react-components" >> $GITHUB_STEP_SUMMARY