Skip to content

Commit

Permalink
ci: add release through GitHub (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
edeckers authored Mar 28, 2022
1 parent 9c6f4fd commit a59a9eb
Show file tree
Hide file tree
Showing 23 changed files with 2,048 additions and 1,381 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["@commitlint/config-conventional"] }
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
android/
lib/
node_modules/
output/
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": ["@react-native-community", "prettier"],
"rules": {
"prettier/prettier": [
"error",
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
android-avd-ram-size: 1024M
android-promise-timeout-milliseconds: 75_000L
android-sdk-root: /Users/ely/Library/Android/sdk
node-version: 12
node-version: 14

jobs:
build-typescript-linux:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release to GitHub and Npm
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: '0 1 * * *'

env:
node-version: 12
node-version: 14
android-api-level: 31

jobs:
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn lint
yarn test
15 changes: 15 additions & 0 deletions .jestrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"preset": "react-native",
"modulePathIgnorePatterns": ["<rootDir>/lib/"],
"reporters": [
"default",
[
"jest-junit",
{
"suiteName": "jest tests",
"outputDirectory": "./output",
"outputName": "typescript-test-output.xml"
}
]
]
}
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
16 changes: 16 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["develop", "main"],
"plugins": [
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json"
]
}
],
"@semantic-release/github"
]
}
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ help:
lint: build
bin/run-lint

release: build
bin/run-release

run: build
cd example && yarn && yarn start

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,4 +586,3 @@ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the
## License
MPL-2.0
73 changes: 38 additions & 35 deletions android/gradle.lockfile

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["module:metro-react-native-babel-preset"]
}
30 changes: 30 additions & 0 deletions bin/run-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

function cd_to_root_directory () {
cd `dirname ${0}`/../../
}

function publish_semantic_release () {
echo "Publishing release"

publish_result=`yarn semantic-release`
echo "${publish_result}"

no_release_count=`echo "${publish_result}" | grep -cim1 "no new version"`
is_release=`[ ${no_release_count} -eq 0 ] && echo 1 || echo 0`

if [[ ${is_release} -ne 1 ]]; then
echo "No release was created. Aborting."
exit 0
fi

echo "Published release"
}

function build_dist () {
yarn
}

cd_to_root_directory

publish_semantic_release
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ PODS:
- React-jsinspector (0.66.1)
- React-logger (0.66.1):
- glog
- react-native-blob-courier (3.0.3):
- react-native-blob-courier (3.0.4):
- React
- React-perflogger (0.66.1)
- React-RCTActionSheet (0.66.1):
Expand Down Expand Up @@ -511,7 +511,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: db2f6e22a534d466fc0e34e622df47d9d20bab2f
React-jsinspector: 8c0517dee5e8c70cd6c3066f20213ff7ce54f176
React-logger: bfddd3418dc1d45b77b822958f3e31422e2c179b
react-native-blob-courier: c84f6dc41cec5652f50aaf272f93a623975bf4c2
react-native-blob-courier: 050eb1228bb23e450613f9f74f31a695cf4ddfbd
React-perflogger: fcac6090a80e3d967791b4c7f1b1a017f9d4a398
React-RCTActionSheet: caf5913d9f9e605f5467206cf9d1caa6d47d7ad6
React-RCTAnimation: 6539e3bf594f6a529cd861985ba6548286ae1ead
Expand Down
22 changes: 13 additions & 9 deletions ios/BlobCourier.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
5F84771B5E443D02DACF06B9 /* libPods-BlobCourierTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFE83B27012D9C89DE2AA201 /* libPods-BlobCourierTests.a */; };
B4D246CE99CE282849547A91 /* libPods-BlobCourier.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FF03FEEF6E261B6C03FBF0 /* libPods-BlobCourier.a */; };
B8CB3FC309023B2A7FAF9671 /* libPods-BlobCourier-BlobCourierTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A36783EDD120C6992821F367 /* libPods-BlobCourier-BlobCourierTests.a */; };
B92C3A1025935C2700630464 /* EmbeddedHttpServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B92C3A0F25935C2700630464 /* EmbeddedHttpServer.swift */; };
B96829D9254EC727002B4B04 /* UploaderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9409539253E1F5800A58583 /* UploaderDelegate.swift */; };
B96829DF254EC736002B4B04 /* DownloaderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B940948F253DFC0800A58583 /* DownloaderDelegate.swift */; };
Expand Down Expand Up @@ -66,9 +66,10 @@
/* Begin PBXFileReference section */
0656379707A557E375019BF3 /* Pods-BlobCourier-BlobCourierTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlobCourier-BlobCourierTests.release.xcconfig"; path = "Target Support Files/Pods-BlobCourier-BlobCourierTests/Pods-BlobCourier-BlobCourierTests.release.xcconfig"; sourceTree = "<group>"; };
09C65277E35A21C959D625EC /* Pods-BlobCourier.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlobCourier.release.xcconfig"; path = "Target Support Files/Pods-BlobCourier/Pods-BlobCourier.release.xcconfig"; sourceTree = "<group>"; };
0B3E67BEB08C4283A6BA0AEF /* Pods-BlobCourierTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlobCourierTests.release.xcconfig"; path = "Target Support Files/Pods-BlobCourierTests/Pods-BlobCourierTests.release.xcconfig"; sourceTree = "<group>"; };
134814201AA4EA6300B7C361 /* libBlobCourier.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBlobCourier.a; sourceTree = BUILT_PRODUCTS_DIR; };
28FF03FEEF6E261B6C03FBF0 /* libPods-BlobCourier.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BlobCourier.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A36783EDD120C6992821F367 /* libPods-BlobCourier-BlobCourierTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BlobCourier-BlobCourierTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AFE83B27012D9C89DE2AA201 /* libPods-BlobCourierTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BlobCourierTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B582B99CFA330E8B9AA72A84 /* Pods-BlobCourier.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlobCourier.debug.xcconfig"; path = "Target Support Files/Pods-BlobCourier/Pods-BlobCourier.debug.xcconfig"; sourceTree = "<group>"; };
B92C3A0F25935C2700630464 /* EmbeddedHttpServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmbeddedHttpServer.swift; sourceTree = "<group>"; };
B940948F253DFC0800A58583 /* DownloaderDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloaderDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -93,6 +94,7 @@
B9AF75BD25DF29DF00B68816 /* CancelParameters.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CancelParameters.swift; sourceTree = "<group>"; };
B9AF75BE25DF29DF00B68816 /* CancelParameterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CancelParameterFactory.swift; sourceTree = "<group>"; };
D8C2198A611AEEDA6D5347D4 /* Pods-BlobCourier-BlobCourierTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlobCourier-BlobCourierTests.debug.xcconfig"; path = "Target Support Files/Pods-BlobCourier-BlobCourierTests/Pods-BlobCourier-BlobCourierTests.debug.xcconfig"; sourceTree = "<group>"; };
EC1CE78A005E7D5559E04E80 /* Pods-BlobCourierTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlobCourierTests.debug.xcconfig"; path = "Target Support Files/Pods-BlobCourierTests/Pods-BlobCourierTests.debug.xcconfig"; sourceTree = "<group>"; };
F4FF95D5245B92E700C19C63 /* BlobCourier-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BlobCourier-Bridging-Header.h"; sourceTree = "<group>"; };
F4FF95D6245B92E800C19C63 /* BlobCourier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlobCourier.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -111,7 +113,7 @@
buildActionMask = 2147483647;
files = (
B96829EA254EC872002B4B04 /* libBlobCourier.a in Frameworks */,
B8CB3FC309023B2A7FAF9671 /* libPods-BlobCourier-BlobCourierTests.a in Frameworks */,
5F84771B5E443D02DACF06B9 /* libPods-BlobCourierTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -125,6 +127,8 @@
09C65277E35A21C959D625EC /* Pods-BlobCourier.release.xcconfig */,
D8C2198A611AEEDA6D5347D4 /* Pods-BlobCourier-BlobCourierTests.debug.xcconfig */,
0656379707A557E375019BF3 /* Pods-BlobCourier-BlobCourierTests.release.xcconfig */,
EC1CE78A005E7D5559E04E80 /* Pods-BlobCourierTests.debug.xcconfig */,
0B3E67BEB08C4283A6BA0AEF /* Pods-BlobCourierTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -162,7 +166,7 @@
isa = PBXGroup;
children = (
28FF03FEEF6E261B6C03FBF0 /* libPods-BlobCourier.a */,
A36783EDD120C6992821F367 /* libPods-BlobCourier-BlobCourierTests.a */,
AFE83B27012D9C89DE2AA201 /* libPods-BlobCourierTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -341,7 +345,7 @@
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-BlobCourier-BlobCourierTests-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-BlobCourierTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -376,7 +380,7 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-BlobCourier-BlobCourierTests/Pods-BlobCourier-BlobCourierTests-resources.sh",
"${PODS_ROOT}/Target Support Files/Pods-BlobCourierTests/Pods-BlobCourierTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -385,7 +389,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlobCourier-BlobCourierTests/Pods-BlobCourier-BlobCourierTests-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlobCourierTests/Pods-BlobCourierTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -581,7 +585,7 @@
};
B96829EE254EC872002B4B04 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D8C2198A611AEEDA6D5347D4 /* Pods-BlobCourier-BlobCourierTests.debug.xcconfig */;
baseConfigurationReference = EC1CE78A005E7D5559E04E80 /* Pods-BlobCourierTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "";
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -613,7 +617,7 @@
};
B96829EF254EC872002B4B04 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0656379707A557E375019BF3 /* Pods-BlobCourier-BlobCourierTests.release.xcconfig */;
baseConfigurationReference = 0B3E67BEB08C4283A6BA0AEF /* Pods-BlobCourierTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "";
CLANG_ANALYZER_NONNULL = YES;
Expand Down
3 changes: 1 addition & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ SPEC CHECKSUMS:
ReactCommon: eafed38eec7b591c31751bfa7494801618460459
Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4

PODFILE CHECKSUM: 5b81b0b62aa0486601d856fd54f7f21f0b2aeb8b
PODFILE CHECKSUM: dcfc96a2ccffaa753b814abb8cba33510d3c85ee

COCOAPODS: 1.11.2

15 changes: 0 additions & 15 deletions jest.config.js

This file was deleted.

Loading

0 comments on commit a59a9eb

Please sign in to comment.