diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d64feba6..f3693558 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,16 +8,56 @@ on: - "*.*" jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "18.x" + + - run: yarn + + - name: Typecheck + run: yarn types + + - name: Test + run: yarn test + + staging: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "18.x" + + - run: yarn + + - name: Build staging components + run: yarn build:components + env: + IS_STAGING: true + + - uses: jakejarvis/s3-sync-action@master + with: + args: --follow-symlinks --cache-control "max-age=31536000,public,immutable" + env: + AWS_S3_BUCKET: "courier-push-provider-prod-couriercomponentsbucket-jqacxmhbzmwx" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + SOURCE_DIR: "./packages/components/dist" + release: + needs: test + runs-on: ubuntu-latest env: - COURIER_WS_URL: ${{ secrets.COURIER_WS_URL }} NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-node@v4 with: @@ -28,14 +68,6 @@ jobs: - run: yarn - - name: Configure git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Version packages - run: npx lerna version patch --yes --force-publish=* - - name: Publish to npm run: yarn lerna:publish diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml deleted file mode 100644 index 37bf85b2..00000000 --- a/.github/workflows/staging.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Staging - -on: - push: - branches: - - main - tags-ignore: - - "*.*" - -jobs: - staging-components: - env: - COURIER_WS_URL: ${{ secrets.COURIER_WS_URL }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - registry-url: "https://registry.npmjs.org" - node-version: "18.x" - scope: "@trycourier" - always-auth: true - - run: yarn - - run: yarn build:components - env: - IS_STAGING: true - - uses: jakejarvis/s3-sync-action@master - with: - args: --follow-symlinks --cache-control "max-age=31536000,public,immutable" - env: - AWS_S3_BUCKET: "courier-push-provider-prod-couriercomponentsbucket-jqacxmhbzmwx" - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - SOURCE_DIR: "./packages/components/dist"