Skip to content

Commit f919fa8

Browse files
committed
Migrated to GitHub actions
1 parent 5d96459 commit f919fa8

File tree

6 files changed

+191
-252
lines changed

6 files changed

+191
-252
lines changed

.github/workflows/ci.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ experimental, develop, main ]
6+
pull_request:
7+
branches: [ develop ]
8+
9+
permissions:
10+
contents: write
11+
id-token: write
12+
13+
env:
14+
NODE_VERSION: 22.12.0
15+
RELEASE_BRANCH: main
16+
PREVIEW_BRANCH: develop
17+
CANARY_BRANCH: experimental
18+
NPM_CONFIG_PROVENANCE: true
19+
20+
jobs:
21+
build:
22+
name: Process Code
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Use Node ${{ env.NODE_VERSION }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ env.NODE_VERSION }}
33+
cache: yarn
34+
35+
- name: Enable Corepack (Yarn)
36+
run: corepack enable
37+
38+
- name: Install Dependencies
39+
run: yarn install
40+
41+
- name: Build Code
42+
run: yarn build
43+
44+
canary:
45+
name: Canary Packages
46+
needs: build
47+
runs-on: ubuntu-latest
48+
if: github.ref_name == 'experimental'
49+
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Use Node ${{ env.NODE_VERSION }}
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: ${{ env.NODE_VERSION }}
60+
registry-url: https://registry.npmjs.org/
61+
62+
- name: Enable Corepack
63+
run: corepack enable
64+
65+
- name: Install Dependencies
66+
run: yarn install
67+
68+
- name: Build Code
69+
run: yarn build
70+
71+
- name: Configure Git
72+
run: |
73+
git config --global user.email "releases@piral.io"
74+
git config --global user.name "Piral Release Bot"
75+
76+
- name: Set Build id
77+
run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV
78+
env:
79+
GITHUB_SHA: ${{ github.sha }}
80+
81+
- name: Canary-Release Packages
82+
run: yarn ci:canary
83+
env:
84+
NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback
85+
NPM_CONFIG_PROVENANCE: true
86+
87+
prerelease:
88+
name: Preview Packages
89+
needs: build
90+
runs-on: ubuntu-latest
91+
if: github.ref_name == 'develop'
92+
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v4
96+
with:
97+
fetch-depth: 0
98+
99+
- name: Use Node ${{ env.NODE_VERSION }}
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: ${{ env.NODE_VERSION }}
103+
registry-url: https://registry.npmjs.org/
104+
105+
- name: Enable Corepack
106+
run: corepack enable
107+
108+
- name: Install Dependencies
109+
run: yarn install
110+
111+
- name: Build Code
112+
run: yarn build
113+
114+
- name: Configure Git
115+
run: |
116+
git config --global user.email "releases@piral.io"
117+
git config --global user.name "Piral Release Bot"
118+
119+
- name: Set Build id
120+
run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV
121+
env:
122+
GITHUB_SHA: ${{ github.sha }}
123+
124+
- name: Pre-Release Packages
125+
run: yarn ci:prerelease
126+
env:
127+
NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback
128+
NPM_CONFIG_PROVENANCE: true
129+
130+
release:
131+
name: Release Packages
132+
needs: build
133+
runs-on: ubuntu-latest
134+
if: github.ref_name == 'main'
135+
136+
steps:
137+
- name: Checkout
138+
uses: actions/checkout@v4
139+
with:
140+
fetch-depth: 0
141+
token: ${{ secrets.GH_PAT }}
142+
143+
- name: Use Node ${{ env.NODE_VERSION }}
144+
uses: actions/setup-node@v4
145+
with:
146+
node-version: ${{ env.NODE_VERSION }}
147+
registry-url: https://registry.npmjs.org/
148+
149+
- name: Enable Corepack
150+
run: corepack enable
151+
152+
- name: Install Dependencies
153+
run: yarn install
154+
155+
- name: Build Code
156+
run: yarn build
157+
158+
- name: Configure Git
159+
run: |
160+
git config --global user.email "releases@piral.io"
161+
git config --global user.name "Piral Release Bot"
162+
163+
- name: Set Build id
164+
run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV
165+
env:
166+
GITHUB_SHA: ${{ github.sha }}
167+
168+
- name: Update Release Date
169+
run: yarn ci:version-update
170+
171+
- name: Release Packages
172+
run: yarn ci:release
173+
env:
174+
NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback
175+
NPM_CONFIG_PROVENANCE: true
176+
177+
- name: Update Branches
178+
run: |
179+
git push origin ${RELEASE_BRANCH} --force
180+
git push --tags

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL"
132

143
on:
154
push:
165
branches: [ develop, main ]
176
pull_request:
18-
# The branches below must be a subset of the branches above
197
branches: [ develop ]
208
schedule:
219
- cron: '19 3 * * 1'
@@ -39,7 +27,7 @@ jobs:
3927

4028
# Initializes the CodeQL tools for scanning.
4129
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
30+
uses: github/codeql-action/init@v3
4331
with:
4432
languages: ${{ matrix.language }}
4533
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +38,7 @@ jobs:
5038
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5139
# If this step fails, then you should remove it and run the build manually (see below)
5240
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
41+
uses: github/codeql-action/autobuild@v3
5442

5543
# ℹ️ Command-line programs to run using the OS shell.
5644
# 📚 https://git.io/JvXDl
@@ -64,4 +52,4 @@ jobs:
6452
# make release
6553

6654
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
55+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)