[Release] Create Branch #93
Workflow file for this run
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: "[Release] Create Branch" | |
on: | |
workflow_dispatch: | |
jobs: | |
create-release: | |
name: Create Release | |
runs-on: ubuntu-24.04 | |
env: | |
NODE_OPTIONS: "--max-old-space-size=7168" | |
RELEASE_BRANCH: "release-angusbayley-TEST" | |
steps: | |
- name: generate token | |
id: generate-token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.GH_BOT_APP_ID }} | |
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: develop | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Setup git user | |
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop | |
- name: create release branch | |
run: | | |
git checkout -b $RELEASE_BRANCH | |
# - name: Setup the toolchain | |
# uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop | |
# - name: install dependencies | |
# run: pnpm i | |
# - name: Build libs | |
# run: pnpm build:libs | |
# - name: import CAL tokens | |
# run: pnpm import:cal-tokens | |
# - name: commit new tokens | |
# run: | | |
# git add . | |
# git commit -m 'chore(prerelease) update cryptoassets' || echo "No new tokens added" | |
# - name: update sortByMarketcap snapshot | |
# run: pnpm common jest --runTestsByPath src/currencies/sortByMarketcap.test.ts -u | |
# - name: commit sortByMarketcap.test.ts | |
# run: | | |
# git add . | |
# git commit -m 'update sortByMarketcap snapshot' || echo "No changes in snapshot of sortByMarketcap.test.ts" | |
- name: ls .changeset/*.md | |
run: | | |
ls .changeset/*.md | |
- name: conditional Update patch changes to patch | |
run: | | |
if ls .changeset/*.md >/dev/null 2>&1; then | |
for file in .changeset/*.md; do | |
if grep -q ": minor" "$file"; then | |
if [ -s "$file" ]; then | |
echo "about to run sed on $file" | |
sed -i '/---/{ | |
n | |
s/: minor/: patch/ | |
}' "$file" | |
fi | |
fi | |
done | |
else | |
echo "No .md files found in .changeset directory. Skipping." | |
fi | |
- name: Update patch changes to patch | |
run: | | |
for file in .changeset/*.md; do | |
if grep -q ": minor" "$file"; then | |
sed -i '' -e '/---/{ | |
n | |
s/: minor/: patch/ | |
}' "$file" | |
fi | |
done | |
- name: enter prerelease mode | |
run: pnpm changeset pre enter next | |
- name: commit | |
run: | | |
git add . | |
git commit -m "chore(prerelease): :rocket: entering prerelease mode" | |
- name: Get date | |
id: date | |
run: | | |
echo "date=$(date +%F)" >> $GITHUB_OUTPUT | |
- name: push | |
run: | | |
git push origin $RELEASE_BRANCH | |
gh pr create --title ":rocket: [NOT A REAL RELEASE - TEST ONLY, by @angusbayley] Release ${{ steps.date.outputs.date }}" -F .github/templates/release.md --base main --head $RELEASE_BRANCH | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |