Skip to content

Commit 21acf78

Browse files
committed
WIP: Switching to Github Actions and changesets
1 parent 62e3539 commit 21acf78

File tree

8 files changed

+910
-113
lines changed

8 files changed

+910
-113
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets).
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/green-peaches-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@journeyapps/sqlcipher": patch
3+
---
4+
5+
Switch release automation to Changesets-based package publishing and GitHub Actions workflows.

.github/workflows/release.yml

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
10+
11+
permissions:
12+
id-token: write
13+
contents: write
14+
pull-requests: write
15+
16+
env:
17+
SECRETS: ${{ toJSON(secrets) }}
18+
ELECTRON_VERSION: 41.0.0
19+
20+
jobs:
21+
release:
22+
name: Release
23+
runs-on: ubuntu-latest
24+
outputs:
25+
published: ${{ steps.changesets.outputs.published }}
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v6
29+
with:
30+
lfs: true
31+
fetch-depth: 0
32+
33+
- name: Setup NodeJS
34+
uses: actions/setup-node@v6
35+
with:
36+
node-version-file: .nvmrc
37+
cache: pnpm
38+
registry-url: https://registry.npmjs.org
39+
40+
- name: Install PNPM
41+
run: npm i pnpm@10 -g
42+
43+
- name: Install Dependencies
44+
run: npm_config_build_from_source=true pnpm install --frozen-lockfile
45+
46+
- name: Verify
47+
run: pnpm test
48+
49+
- name: Ensure pending changesets exist for dev publish
50+
# Removed so that we can test dev before workflow is available on master (i.e. we can't manually trigger workflow now)
51+
# if: ${{ github.event_name == 'workflow_dispatch' }}
52+
run: |
53+
if ! find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit | grep -q .; then
54+
echo "No pending changesets found. Add a changeset before running a dev publish."
55+
exit 1
56+
fi
57+
58+
- name: Dev Publish
59+
# Removed so that we can test dev before workflow is available on master (i.e. we can't manually trigger workflow now)
60+
# if: ${{ github.event_name == 'workflow_dispatch' }}
61+
run: pnpm release:dev
62+
env:
63+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
65+
66+
# - name: Prod Create Release Pull Request or Publish
67+
# if: ${{ github.event_name == 'push' }}
68+
# uses: changesets/action@v1
69+
# id: changesets
70+
# with:
71+
# version: pnpm version-packages
72+
# publish: pnpm release
73+
# env:
74+
# GITHUB_TOKEN: ${{ github.token }}
75+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
76+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
78+
# Binary publishing is temporarily disabled.
79+
# Consumers fall back to source builds when they install snapshot or release packages.
80+
#
81+
# publish-binaries:
82+
# name: ${{ matrix.name }}
83+
# needs: release
84+
# if: ${{ github.event_name == 'push' && needs.release.outputs.published == 'true' }}
85+
# runs-on: ${{ matrix.runner }}
86+
# defaults:
87+
# run:
88+
# shell: bash
89+
# strategy:
90+
# fail-fast: false
91+
# matrix:
92+
# include:
93+
# - name: build-24
94+
# runner: ubuntu-latest
95+
# node_arch: x64
96+
# target_arch: ""
97+
# run_tests: true
98+
# run_electron_tests: false
99+
# - name: build-electron-41
100+
# runner: ubuntu-latest
101+
# node_arch: x64
102+
# target_arch: ""
103+
# run_tests: false
104+
# run_electron_tests: true
105+
# - name: build-macos-24
106+
# runner: macos-13
107+
# node_arch: x64
108+
# target_arch: ""
109+
# run_tests: true
110+
# run_electron_tests: false
111+
# - name: build-macos-24-arm64
112+
# runner: macos-13
113+
# node_arch: x64
114+
# target_arch: arm64
115+
# run_tests: false
116+
# run_electron_tests: false
117+
# - name: windows-24_x86
118+
# runner: windows-latest
119+
# node_arch: x86
120+
# target_arch: ""
121+
# run_tests: true
122+
# run_electron_tests: true
123+
# - name: windows-24_x64
124+
# runner: windows-latest
125+
# node_arch: x64
126+
# target_arch: ""
127+
# run_tests: true
128+
# run_electron_tests: true
129+
# - name: windows-24_arm64
130+
# runner: windows-latest
131+
# node_arch: x64
132+
# target_arch: arm64
133+
# run_tests: false
134+
# run_electron_tests: false
135+
# steps:
136+
# - name: Checkout Repo
137+
# uses: actions/checkout@v6
138+
# with:
139+
# lfs: true
140+
# fetch-depth: 0
141+
#
142+
# - name: Setup NodeJS
143+
# uses: actions/setup-node@v6
144+
# with:
145+
# node-version-file: .nvmrc
146+
# architecture: ${{ matrix.node_arch }}
147+
# cache: pnpm
148+
#
149+
# - name: Install PNPM
150+
# run: npm i pnpm@10 -g
151+
#
152+
# - name: Install Linux dependencies
153+
# if: ${{ runner.os == 'Linux' }}
154+
# run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-dev libxtst6 libxss1 libnss3 libasound2 xvfb
155+
#
156+
# - name: Install Dependencies
157+
# run: npm_config_build_from_source=true pnpm install --frozen-lockfile
158+
#
159+
# - name: Build
160+
# env:
161+
# TARGET_ARCH: ${{ matrix.target_arch }}
162+
# run: |
163+
# GYP_ARGS=(
164+
# --runtime=electron
165+
# --target="${ELECTRON_VERSION}"
166+
# --dist-url=https://electronjs.org/headers
167+
# )
168+
# if [[ -n "${TARGET_ARCH:-}" ]]; then
169+
# GYP_ARGS+=(--target_arch="${TARGET_ARCH}")
170+
# fi
171+
# pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}"
172+
#
173+
# - name: Run Tests
174+
# if: ${{ matrix.run_tests }}
175+
# run: pnpm test
176+
#
177+
# - name: Run Electron Tests
178+
# if: ${{ matrix.run_electron_tests && runner.os == 'Linux' }}
179+
# run: |
180+
# pnpm run pretest
181+
# xvfb-run pnpm exec electron-mocha --timeout 480000
182+
#
183+
# - name: Run Electron Tests
184+
# if: ${{ matrix.run_electron_tests && runner.os == 'Windows' }}
185+
# run: pnpm exec electron-mocha --timeout 480000
186+
#
187+
# - name: Publish Binaries
188+
# env:
189+
# TARGET_ARCH: ${{ matrix.target_arch }}
190+
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
191+
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
192+
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
193+
# run: |
194+
# GYP_ARGS=(
195+
# --runtime=electron
196+
# --target="${ELECTRON_VERSION}"
197+
# --dist-url=https://electronjs.org/headers
198+
# )
199+
# if [[ -n "${TARGET_ARCH:-}" ]]; then
200+
# GYP_ARGS+=(--target_arch="${TARGET_ARCH}")
201+
# fi
202+
# pnpm exec node-pre-gyp publish "${GYP_ARGS[@]}"

0 commit comments

Comments
 (0)