Skip to content

Adjust Github Actions workflows to the new setup #399

Adjust Github Actions workflows to the new setup

Adjust Github Actions workflows to the new setup #399

Workflow file for this run

name: Pull Request Build
on: pull_request
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 20
- name: Set PR version
run: |
echo "DEPLOY_PREVIEW_VERSION=0.0.0-pr$PR_ID.$BUILD_NUMBER" >> $GITHUB_ENV
echo "DEPLOY_PREVIEW_TAG=pr$PR_ID.$BUILD_NUMBER" >> $GITHUB_ENV
env:
PR_ID: ${{ github.event.number }}
BUILD_NUMBER: ${{ github.run_number }}
- name: Install dependencies
run: yarn install
- name: Build packages
run: yarn build
- name: Run tests
run: yarn test
- name: Bump versions
run: |
git reset --hard
echo "Deploy preview version: '$DEPLOY_PREVIEW_VERSION'"
# Bumping repluggable-core & repluggable versions
yarn workspace repluggable-core version "$DEPLOY_PREVIEW_VERSION"
yarn workspace repluggable version "$DEPLOY_PREVIEW_VERSION"
# Adding the new version of repluggable-core to repluggable
export CORE_VERSION=$(npm pkg get version --workspace=repluggable-core | awk -F ': ' '{print $2}' | tr -d ' }"' | xargs)
echo "repluggable-core version is $CORE_VERSION, adding it to repluggable"
yarn workspace repluggable add repluggable-core@$CORE_VERSION
git status -vv
git add . || true
git commit -m "Bump prerelease version" || true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: npm publish repluggable-core
run: |
echo "Publishing repluggable with tag: [$DEPLOY_PREVIEW_TAG]"
npm publish --workspace repluggable-core --tag "$DEPLOY_PREVIEW_TAG"
echo "::notice::repluggable-core@$DEPLOY_PREVIEW_VERSION"
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
- name: npm publish repluggable
run: |
echo "Publishing repluggable with tag: [$DEPLOY_PREVIEW_TAG]"
npm publish --workspace repluggable --tag "$DEPLOY_PREVIEW_TAG"
echo "::notice::repluggable@$DEPLOY_PREVIEW_VERSION"
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}