Skip to content

Commit

Permalink
build: add react-native release action (#215)
Browse files Browse the repository at this point in the history
* build(wrappers/react-native/deps): bump micromatch from 4.0.4 to 4.0.6

* build: add react-native release action

* refactor: make publish for react-native wrapper better scoped

* build: update publish.sh for scoped releases

* fix: fix publish shell script

* fix: remove quotes from if statement

* fix: fix typo
  • Loading branch information
afonsobarracha authored Aug 12, 2024
1 parent ac7d803 commit c621e3e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci-wrapper-rn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
registry-url: https://registry.npmjs.org

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "zulu"
Expand Down Expand Up @@ -124,6 +124,12 @@ jobs:
node-version: 18.x
registry-url: https://registry.npmjs.org

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "zulu"

- name: Run yarn install
run: yarn install --frozen-lockfile

Expand Down
12 changes: 10 additions & 2 deletions wrappers/react-native/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ export PATH="$PATH:node_modules/.bin"
# Fetch the current version from the package.json
new_version=$(node -pe "require('./package.json').version")

# Version to this new unstable version
yarn publish --no-git-tag-version --new-version $new_version
# Fetch package name
package_name=$(node -pe "require('./package.json').name")

# Check if the new version is not the current
new_version_exists=$(yarn info $package_name --json | jq --arg version "$new_version" -r '.data.versions | any(index($version))')

if [[ $new_version_exists == "false" ]]; then
# Version to this new unstable version
yarn publish --no-git-tag-version --new-version $new_version
fi

# Reset changes to the package.json
git checkout -- package.json
19 changes: 12 additions & 7 deletions wrappers/react-native/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,7 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"

braces@3.0.3, braces@^3.0.2:
braces@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
Expand Down Expand Up @@ -4368,12 +4368,12 @@ [email protected], metro@^0.76.9:
yargs "^17.6.2"

micromatch@^4.0.4:
version "4.0.5"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
version "4.0.6"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.6.tgz#ab4e37c42726b9cd788181ba4a2a4fead8e394a3"
integrity sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ==
dependencies:
braces "^3.0.2"
picomatch "^2.3.1"
braces "^3.0.3"
picomatch "^4.0.2"

[email protected], "mime-db@>= 1.43.0 < 2":
version "1.52.0"
Expand Down Expand Up @@ -4752,11 +4752,16 @@ picocolors@^1.0.1:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1"
integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==

picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1:
picomatch@^2.0.4, picomatch@^2.2.3:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

picomatch@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab"
integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==

pify@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
Expand Down
12 changes: 10 additions & 2 deletions wrappers/wasm/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ set -e
# Add dev dependencies to current path
export PATH="$PATH:node_modules/.bin"

# Fetch package name
package_name=$(node -pe "require('./package.json').name")

# Fetch the current version from the package.json
new_version=$(node -pe "require('./package.json').version")

# Version to this new unstable version
yarn publish --no-git-tag-version --new-version $new_version
# Check if the new version is not the current
new_version_exists=$(yarn info $package_name --json | jq --arg version "$new_version" -r '.data.versions | any(index($version))')

if [[ $new_version_exists == "false" ]]; then
# Version to this new unstable version
yarn publish --no-git-tag-version --new-version $new_version
fi

# Reset changes to the package.json
git checkout -- package.json

0 comments on commit c621e3e

Please sign in to comment.