Skip to content

Commit 09eeee1

Browse files
authored
ci: add CI, CodeQL and release automation (#18)
* chore: stop tracking the generated build output `prepare` runs `expo-module build` on every install, so `build/` was already being regenerated behind the tracked copy, which is a babel version behind what the source compiles to now. It also blocks release-it: every `yarn install` leaves the tree dirty, and a dirty tree aborts a release. npm still gets the directory. It's in `files`, and `prepare` rebuilds it on publish and on git installs. * build(deps): add eslint 8 and release-it `yarn lint` has been broken because eslint isn't in the lockfile at all, so it resolved to v10, which wants a flat config while the repo has `.eslintrc.js`. expo-module-scripts pulls eslint-config-universe 12, and that one is built against eslint 8. release-it and @release-it/conventional-changelog are for the release workflow. * ci: add validation and codeql workflows The repo had no workflows at all, so nothing ran on a PR. CI covers pushes to master and every PR: lint, test, build, then `npm pack --dry-run` so an empty tarball fails the job now that `build/` is generated at install time instead of committed. CodeQL follows safe-jsx: PRs, pushes to master, and a weekly scan. * ci: cut releases with release-it and a generated changelog 1.0.8 was bumped, tagged, released and published by hand, and CHANGELOG.md stopped at 1.0.6 under `@config-plugins/react-native-codepush`, a name this package has never been published under. release-it now derives all of it from the conventional commits since the last tag: the version bump, the CHANGELOG section, the annotated tag message and the GitHub release body. A `!` or a `BREAKING CHANGE:` footer bumps the major and shows up under the same `⚠ BREAKING CHANGES` heading in all three. The trigger is `workflow_dispatch` with an optional increment override, not a push to master. conventional-commits treats any commit as at least a patch, so pushing a README fix would otherwise ship a version. Backfilled 1.0.7 and 1.0.8 from git history and reshaped the older entries into the layout release-it writes, so the file reads as one thing. * build(deps): add prettier so eslint stops hanging `yarn lint` didn't fail on eslint 8, it hung with no output, in CI and locally. eslint-config-universe peer-requires `prettier >=3` and it was never installed. eslint-plugin-prettier 5 loads prettier through a synckit worker, and with nothing to load the worker never answers, so eslint blocks forever inside the `prettier/prettier` rule. Nothing prints because the rule never returns. With prettier 3.9.6 installed, `yarn lint` finishes in 4 seconds. * style: format src with prettier 3 `eslint src --fix`. prettier 3 defaults `trailingComma` to `all` where 2 defaulted to `es5`, so almost all of this is commas. The indentation changes in stringsDependency and infoPlistDependency come from #11 and #14, which were written while lint was hanging. * ci: fail lint on warnings universe sets most of its rules to `warn`, so `yarn lint` exits 0 no matter what eslint reports. src is clean as of the commit before this one, so `--max-warnings 0` starts from zero.
1 parent 367e340 commit 09eeee1

49 files changed

Lines changed: 1708 additions & 470 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
validate:
17+
name: Lint, test and build
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v7
21+
22+
- uses: actions/setup-node@v7
23+
with:
24+
node-version: 24
25+
cache: yarn
26+
27+
# `prepare` runs `expo-module prepare`, so this already builds once.
28+
- run: yarn install --frozen-lockfile
29+
30+
# universe sets most of its rules to `warn`, so without this the step
31+
# passes no matter what eslint finds.
32+
- run: yarn lint --max-warnings 0
33+
34+
- run: yarn test
35+
36+
- run: yarn build
37+
38+
# `build/` is generated, so the only way to know the published tarball
39+
# isn't empty is to pack one.
40+
- name: Check the tarball contents
41+
run: npm pack --dry-run

‎.github/workflows/codeql.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
schedule:
9+
- cron: "38 1 * * 2"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: ["javascript"]
24+
25+
steps:
26+
- uses: actions/checkout@v7
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v4
30+
with:
31+
languages: ${{ matrix.language }}
32+
33+
- name: Perform CodeQL Analysis
34+
uses: github/codeql-action/analyze@v4
35+
with:
36+
category: "/language:${{ matrix.language }}"

‎.github/workflows/release.yml‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
increment:
7+
description: "Version increment. Leave empty to infer it from the conventional commits since the last tag."
8+
required: false
9+
default: ""
10+
type: choice
11+
options:
12+
- ""
13+
- patch
14+
- minor
15+
- major
16+
dry-run:
17+
description: "Run release-it without publishing, pushing or tagging."
18+
required: false
19+
default: false
20+
type: boolean
21+
22+
permissions:
23+
contents: write
24+
25+
jobs:
26+
release:
27+
name: Publish to npm
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v7
31+
with:
32+
# conventional-changelog needs the tags and every commit since the
33+
# last one to work out the bump and the changelog entries.
34+
fetch-depth: 0
35+
36+
- uses: actions/setup-node@v7
37+
with:
38+
node-version: 24
39+
cache: yarn
40+
registry-url: https://registry.npmjs.org/
41+
42+
- run: yarn install --frozen-lockfile
43+
44+
- run: yarn lint --max-warnings 0
45+
46+
- run: yarn test
47+
48+
- run: yarn build
49+
50+
# release-it pushes the version commit and the tag back to master, and
51+
# actions/checkout leaves the branch without an upstream to push to.
52+
- run: git branch --set-upstream-to=origin/${{ github.ref_name }}
53+
54+
- name: Release
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58+
INCREMENT: ${{ inputs.increment }}
59+
DRY_RUN: ${{ inputs.dry-run }}
60+
run: |
61+
git config user.email "gabrielstaveira@gmail.com"
62+
git config user.name "Gabriel Taveira"
63+
64+
args="--ci"
65+
if [ -n "$INCREMENT" ]; then
66+
args="$args --increment=$INCREMENT"
67+
fi
68+
if [ "$DRY_RUN" = "true" ]; then
69+
args="$args --dry-run"
70+
fi
71+
72+
yarn release $args

‎.gitignore‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
node_modules
2-
.idea
2+
.idea
3+
4+
# Generated by `expo-module build`, which the `prepare` script runs on every
5+
# install and on publish.
6+
build

‎CHANGELOG.md‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1-
### @config-plugins/react-native-codepush 1.0.0
1+
# Changelog
22

3-
- Expo SDK 49 support
3+
## [1.0.8](https://github.com/GSTJ/react-native-code-push-plugin/compare/1.0.7...v1.0.8) (2026-07-25)
4+
5+
### Features
6+
7+
- support self-hosted codepush servers ([#11](https://github.com/GSTJ/react-native-code-push-plugin/issues/11))
8+
9+
### Bug Fixes
10+
11+
- let node resolve the codepush gradle paths ([#12](https://github.com/GSTJ/react-native-code-push-plugin/issues/12))
12+
13+
## [1.0.7](https://github.com/GSTJ/react-native-code-push-plugin/compare/1.0.6...1.0.7) (2024-02-08)
14+
15+
### Bug Fixes
416

5-
### @config-plugins/react-native-codepush 1.0.2
17+
- kotlin/java semicolon build error ([#7](https://github.com/GSTJ/react-native-code-push-plugin/issues/7))
618

7-
- Update interim README
19+
## 1.0.6 (2024-01-22)
820

9-
### @config-plugins/react-native-codepush 1.0.6
21+
### Features
1022

11-
- Expo SDK 50 support
23+
- Expo SDK 50 support ([#5](https://github.com/GSTJ/react-native-code-push-plugin/issues/5))
1224

13-
### @config-plugins/react-native-codepush 1.0.6
25+
### Bug Fixes
1426

15-
- Fix SDK 49 build error
27+
- Expo SDK 49 build error
28+
29+
## 1.0.2 (2023-11-06)
30+
31+
### Documentation
32+
33+
- update the interim README
34+
35+
## 1.0.0 (2023-11-06)
36+
37+
### Features
38+
39+
- Expo SDK 49 support

‎build/android/buildscriptDependency.d.ts‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎build/android/buildscriptDependency.js‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎build/android/buildscriptDependency.js.map‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎build/android/mainApplicationDependency.d.ts‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎build/android/mainApplicationDependency.js‎

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)