-
-
Notifications
You must be signed in to change notification settings - Fork 265
149 lines (142 loc) · 4.64 KB
/
ci.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# This workflow is the entry point for all CI processes.
# It is from here that all other workflows are launched.
on:
workflow_dispatch:
push:
branches:
- main
- 'renovate/**'
paths-ignore:
- '.github/**'
- '!.github/workflows/ci.yml'
- '!.github/workflows/tests.yml'
- '!.github/workflows/release.yml'
- '**.md'
- .editorconfig
- .gitignore
- '.idea/**'
- '.vscode/**'
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/ci.yml'
- '!.github/workflows/tests.yml'
- '!.github/workflows/release.yml'
- '**.md'
- .editorconfig
- .gitignore
- '.idea/**'
- '.vscode/**'
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
COMMIT_TIMESTAMP: ${{ steps.COMMIT_TIMESTAMP.outputs.COMMIT_TIMESTAMP }}
APP_CHANNEL: ${{ steps.APP_CHANNEL.outputs.APP_CHANNEL }}
APP_VERSION: ${{ steps.APP_VERSION.outputs.APP_VERSION }}
steps:
- uses: actions/checkout@v4
- id: COMMIT_TIMESTAMP
run: echo "COMMIT_TIMESTAMP=$(git show -s --format=%ct ${{ github.sha }})" >> $GITHUB_OUTPUT
- id: APP_CHANNEL
run: echo "APP_CHANNEL=$(if [[ "${{ github.ref }}" == 'refs/heads/develop' ]]; then echo 'beta'; else echo 'latest'; fi)" >> $GITHUB_OUTPUT
- id: APP_VERSION
run: echo "APP_VERSION=3.0.${{ steps.COMMIT_TIMESTAMP.outputs.COMMIT_TIMESTAMP }}$(if [[ "${{ steps.APP_CHANNEL.outputs.APP_CHANNEL }}" != 'latest' ]]; then echo '-${{ steps.APP_CHANNEL.outputs.APP_CHANNEL }}'; else echo ''; fi)" >> $GITHUB_OUTPUT
- run: |
echo "- \`COMMIT_TIMESTAMP\`: ${{ steps.COMMIT_TIMESTAMP.outputs.COMMIT_TIMESTAMP }}" >> $GITHUB_STEP_SUMMARY
echo "- \`APP_CHANNEL\`: ${{ steps.APP_CHANNEL.outputs.APP_CHANNEL }}" >> $GITHUB_STEP_SUMMARY
echo "- \`APP_VERSION\`: ${{ steps.APP_VERSION.outputs.APP_VERSION }}" >> $GITHUB_STEP_SUMMARY
tests:
needs:
- prepare
uses: ./.github/workflows/tests.yml
with:
renderer-template: ${{ matrix.renderer-template }}
app-version: ${{ needs.prepare.outputs.APP_VERSION }}-${{ matrix.renderer-template }}
strategy:
fail-fast: false
matrix:
renderer-template:
- vanilla
- vanilla-ts
- vue
- vue-ts
- react
- react-ts
- react-swc
- react-swc-ts
- preact
- preact-ts
- lit
- lit-ts
- svelte
- svelte-ts
- solid
- solid-ts
# Qwik Has unresolved upstream issue. So I decided to torn it off for now
# - qwik
# - qwik-ts
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write # Allows this job to create releases
needs:
- prepare
- tests
- remove-releases
uses: ./.github/workflows/release.yml
with:
renderer-template: ${{ matrix.renderer-template }}
app-version: ${{ needs.prepare.outputs.APP_VERSION }}-${{ matrix.renderer-template }}
app-channel: ${{ needs.prepare.outputs.APP_CHANNEL }}
strategy:
fail-fast: false
matrix:
renderer-template:
- vanilla
- vanilla-ts
- vue
- vue-ts
- react
- react-ts
- react-swc
- react-swc-ts
- preact
- preact-ts
- lit
- lit-ts
- svelte
- svelte-ts
- solid
- solid-ts
# Qwik Has unresolved upstream issue. So I decided to torn it off for now
# - qwik
# - qwik-ts
# Remove all releases in the project.
# This job is required for the needs of the template itself
# and should not be part of the application.
# Please remove it.
remove-releases:
if: github.repository == 'cawa-93/vite-electron-builder' && github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- tests
uses: ./.github/workflows/remove-releases.yml
permissions:
contents: write # Allows this job to create releases
dependabot:
permissions:
contents: write
pull-requests: write
needs:
- tests
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'cawa-93/vite-electron-builder'
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}