Skip to content

Commit

Permalink
test(Release): test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinsawicki committed Sep 10, 2024
1 parent c2f4b8d commit 03a1781
Showing 1 changed file with 15 additions and 77 deletions.
92 changes: 15 additions & 77 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,94 +10,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
# 1. Checkout the branch (release-test)
- name: Checkout current branch (release-test)
uses: actions/checkout@v2
with:
fetch-depth: 0

# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '20.x'
# cache: 'npm'

# - name: Cache node_modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install modules
run: npm ci

- name: Build icons
run: npm run build:icons

# - name: Run unit tests
# run: npm run check
ref: release-test

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Version and tag packages
# 2. Bump version using Lerna
- name: Bump version with Lerna
run: npx lerna version --conventional-commits --no-changelog --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Configure npm authentication
# run: |
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

# - name: Publish packages to npm
# run: npx lerna publish from-package --yes
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }},
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Push changes back to the repo
# run: |
# git push origin --follow-tags
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Pull latest changes from remote
# run: git pull origin release-test

# - name: Create merge-back PR to main
# uses: peter-evans/create-pull-request@v5
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# commit-message: "Release - version update"
# branch: release-test
# base: main
# title: 'Release - version update'
# body: 'This is an automated PR to merge the release branch into main after version bump and publish.'

- name: Checkout current branch (release-test)
uses: actions/checkout@v2
with:
ref: release-test # Replace with the actual release branch if different

- name: Pull latest changes from remote
run: git pull origin release-test

- name: Commit changes (if any)
# 3. Push the version bump commit to the release-test branch
- name: Push version bump commit to remote
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add .
git diff-index --quiet HEAD || git commit -m "Version bump and changes"
git push origin release-test
# 4. Pull the latest changes from remote
- name: Pull latest changes from remote
run: git pull origin release-test

# 5. Check for changes between release-test and main
- name: Check for changes between release-test and main
run: |
git fetch origin main
Expand All @@ -106,6 +42,7 @@ jobs:
exit 0
fi
# 6. Create merge-back PR to main
- name: Create merge-back PR to main
uses: peter-evans/create-pull-request@v5
with:
Expand All @@ -115,3 +52,4 @@ jobs:
base: main
title: 'Release - version update'
body: 'This is an automated PR to merge the release branch into main after version bump and publish.'

0 comments on commit 03a1781

Please sign in to comment.