-
Notifications
You must be signed in to change notification settings - Fork 37
92 lines (79 loc) · 2.65 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build Test and Version Bump
on:
push:
branches: [ "main" ]
jobs:
version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm i
- name: Check for changesets
id: check_changes
run: |
if [ -n "$(ls .changeset/*.md 2>/dev/null)" ]; then
echo "CHANGESET UPDATE DETECTED"
echo "changes_detected=true" >> $GITHUB_ENV
else
echo "changes_detected=false" >> $GITHUB_ENV
echo "CHANGESET UPDATE NOT DETECTED"
fi
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGES_DETECTED: ${{ env.changes_detected }}
run: |
if [ "${CHANGES_DETECTED}" != "true" ]; then
echo "No changesets detected. Skipping version bump and PR creation."
exit 0
fi
git config user.name github-actions
git config user.email [email protected]
# Create a new branch
git checkout -b version-bump-${{ github.sha }}
# Run version bump
npm run version
# Check if there are changes to commit
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit after version bump. Exiting."
exit 0
fi
# Commit changes
git add .
git commit -m "Version bump, changelog update"
# Push the branch
git push origin version-bump-${{ github.sha }}
# Create Pull Request
gh pr create --title "Version Bump and Changelog Update" --body "Automated version bump, changelog update, and package-lock.json synchronization" --base main --head version-bump-${{ github.sha }}
# test-tauri:
# needs: version-bump
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup node
# uses: actions/setup-node@v4
# with:
# node-version: lts/*
#
# - name: Install Rust stable
# uses: dtolnay/rust-toolchain@stable
# with:
# targets: aarch64-apple-darwin
#
# - name: Install packages
# run: npm install
#
# - name: Build Tauri App
# uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# args: "--target aarch64-apple-darwin"