diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index d971f12b8b27d..aafff654a5e5c 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,5 +1,5 @@ name: Medusa Pipeline -on: [pull_request, workflow_call] # allow this workflow to be called from other workflows +on: [pull_request] # allow this workflow to be called from other workflows jobs: unit-tests: @@ -156,3 +156,38 @@ jobs: run: yarn test:integration:plugins --maxWorkers=50% --silent=false env: DB_PASSWORD: postgres + publish-canary: + needs: [unit-tests, integration-tests-api, integration-tests-plugins] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.5 + with: + fetch-depth: 0 + + - name: Setup Node.js environment + uses: actions/setup-node@v2.4.1 + with: + node-version: "14" + cache: "yarn" + registry-url: 'https://registry.npmjs.org' + - name: "Get Branch Name" + run: | + BRANCH_NAME="${GITHUB_HEAD_REF}" + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV + - name: Format Version Name + run: | + VERSION_NAME=`echo ${{ env.BRANCH_NAME }} | sed "s/[/_]/-/g"` + echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV + - name: Authenticate with NPM + run: | + echo "@oliverjuhl:registry=http://registry.npmjs.org/" > .npmrc + echo "registry=http://registry.npmjs.org/" >> .npmrc + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc + npm whoami + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish Canary + run: lerna publish --yes --canary --preid ${{ env.VERSION_NAME }} --dist-tag ${{ env.VERSION_NAME }} --force-publish="*" + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml deleted file mode 100644 index b446b2cf68033..0000000000000 --- a/.github/workflows/publish-canary.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish canary -on: - pull_request: - branches: - - develop - -jobs: - tests: - uses: ./.github/workflows/action.yml - publish-canary: - needs: [tests] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.3.5 - with: - fetch-depth: 0 - - - name: Setup Node.js environment - uses: actions/setup-node@v2.4.1 - with: - node-version: "14" - cache: "yarn" - registry-url: 'https://registry.npmjs.org' - - name: "Get Branch Name" - run: | - BRANCH_NAME="${GITHUB_HEAD_REF}" - echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV - - name: Format Version Name - run: | - VERSION_NAME=`echo ${{ env.BRANCH_NAME }} | sed "s/[/_]/-/g"` - echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV - - name: Authenticate with NPM - run: | - echo "@oliverjuhl:registry=http://registry.npmjs.org/" > .npmrc - echo "registry=http://registry.npmjs.org/" >> .npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc - npm whoami - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish Canary - run: lerna publish --yes --canary --preid ${{ env.VERSION_NAME }} --force-publish="*" - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file