Skip to content

Commit

Permalink
jobs depend on each other
Browse files Browse the repository at this point in the history
  • Loading branch information
fingerartur committed Nov 20, 2023
1 parent 8dee10e commit e5eaa09
Showing 1 changed file with 17 additions and 45 deletions.
62 changes: 17 additions & 45 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

0 comments on commit e5eaa09

Please sign in to comment.