Fix force publish #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: push rc test | |
on: | |
push: | |
branches: | |
- fix-bugs | |
jobs: | |
# check for changed packages | |
verify-packages: | |
name: Verify changed packages | |
permissions: | |
id-token: write | |
contents: write | |
actions: read | |
runs-on: ubuntu-22.04 | |
outputs: | |
changed_packages: ${{ steps.tag_check_changes.outputs.changed_packages }} | |
latest_tag: ${{ steps.tag_check_changes.outputs.latest_tag }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Prepare pre-requisites | |
uses: ./.github/actions/prepare | |
- name: Install deps | |
run: yarn install-deps | |
- name: Style | |
run: yarn style | |
- name: Build | |
run: yarn nx-build-skip-cache | |
- name: Test | |
run: yarn nx-test-skip-cache | |
- name: Get latest git tag and verify package changes | |
id: tag_check_changes | |
run: | | |
git fetch --prune --unshallow --tags | |
latest_tag=$(git describe --tags --abbrev=0 --match "v*") | |
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT | |
changed_packages=$(lerna changed --json | jq -r 'length') | |
echo "changed_packages=${changed_packages:-0}" >> $GITHUB_OUTPUT | |
# Commit & Push to branch | |
commit-push: | |
name: Commit and push changes | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
needs: verify-packages | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Update RC candidate version ( excluding deploy client ) | |
run: | | |
if [[ ${{ needs.verify-packages.outputs.latest_tag }} != *"rc"* ]]; then | |
yarn versionup:preminor && ./hack/cross-dependency.sh | |
else | |
yarn versionup:prerelease && ./hack/cross-dependency.sh | |
fi | |
- name: Commit changes | |
id: update_version | |
run: | | |
TAG_NAME=$(node -p "require('./lerna.json').version") | |
echo "rc_version=v$TAG_NAME" >> $GITHUB_OUTPUT | |
# Commit all changed files back to the repository | |
- uses: planetscale/ghcommit-action@6ca6b06e9d2de1296143831c53e1d601831ba2a2 | |
with: | |
commit_message: "🤖 Update version to v${{ steps.update_version.outputs.rc_version }}" | |
repo: ${{ github.repository }} | |
branch: ${{ github.head_ref || github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |