User properties #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Checker | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
types: [labeled, opened, synchronize] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
# actions: write | |
checks: write | |
# deployments: write | |
# id-token: write | |
# issues: write | |
# discussions: write | |
# packages: write | |
# pages: write | |
# repository-projects: write | |
# security-events: write | |
# statuses: write | |
jobs: | |
Versioning: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'check tag labels' | |
id: check_pr_labels_major | |
uses: danielchabr/[email protected] | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
hasSome: "Major :star2:,Minor :sparkles:,Patch :bug:,Skip Version" | |
- name: 'Use Node.js' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.base_ref }}" | |
path: 'main' | |
- name: 'Master Default version' | |
run: | | |
cd main | |
_pluginVersion=$(node -p "require('./package.json').version") | |
set -e | |
echo "PLUGIN_VERSION=${_pluginVersion}" >> $GITHUB_ENV | |
echo "new version : ${_pluginVersion}" | |
- name: 'Change patch version' | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'Patch :bug:') }} | |
run: | | |
cd main | |
npm version patch --git-tag-version false | |
_pluginVersion=$(node -p "require('./package.json').version") | |
set -e | |
echo "PLUGIN_VERSION=${_pluginVersion}" >> $GITHUB_ENV | |
echo "new version : ${_pluginVersion}" | |
- name: 'Change Minor version' | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'Minor :sparkles:') }} | |
run: | | |
cd main | |
npm version minor --git-tag-version false | |
_pluginVersion=$(node -p "require('./package.json').version") | |
set -e | |
echo "PLUGIN_VERSION=${_pluginVersion}" >> $GITHUB_ENV | |
echo "new version : ${_pluginVersion}" | |
- name: 'Change Major version' | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'Major :star2:')}} | |
run: | | |
cd main | |
npm version major --git-tag-version false | |
_pluginVersion=$(node -p "require('./package.json').version") | |
set -e | |
echo "PLUGIN_VERSION=${_pluginVersion}" >> $GITHUB_ENV | |
echo "new version : ${_pluginVersion}" | |
- name: 'Cleanup main' | |
run: | | |
rm -rf main | |
- name: Get Source branch | |
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true | |
uses: actions/checkout@v3 | |
with: | |
ref: "${{ github.head_ref || github.ref_name }}" | |
- name: History | |
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true | |
uses: jitterbit/get-changed-files@v1 | |
id: history | |
- name: Check whatsnew.md status | |
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true | |
id: whatsnew | |
run: | | |
_isFilechanged=false | |
for changed_file in ${{ steps.history.outputs.modified }}; do | |
if [[ ${changed_file} == *"whatsnew.md"* ]]; then | |
_isFilechanged=true | |
fi | |
done | |
echo "passed=${_isFilechanged}" >> $GITHUB_OUTPUT | |
- name: Failed whatsnew.md status | |
if: ${{ steps.whatsnew.outputs.passed == 'false'}} | |
run: | | |
echo "::error::You have miss to update whatsnew.md with latest changes" | |
exit 1 | |
- name: 'Update version' | |
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true | |
run: | | |
sed -i "3 s/.*/\t\"version\":\"${{ env.PLUGIN_VERSION }}\",/" package.json | |
cat package.json | |
- name: Commit and push changes | |
if: ${{ steps.check_pr_labels_major.outputs.passed }} == true | |
uses: devops-infra/action-commit-push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
commit_message: "Updated ${{ env.PLUGIN_VERSION }}" | |
commit_prefix: "[AUTO]" | |
force: false | |
react_ios: | |
needs: Versioning | |
runs-on: macos-14 | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org/ | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '17' | |
- name: Build it | |
run: | | |
npm install | |
export USE_FRAMEWORKS=dynamic | |
export NO_FLIPPER=1 | |
cd example && npm install | |
npx pod-install | |
- name: Run test | |
run: | | |
npm run build | |
#npm test | |
#yarn example run ios | |
# react_android: | |
# needs: react_ios | |
# runs-on: macos-14 | |
# steps: | |
# - name: Check out Git repository | |
# uses: actions/checkout@v2 | |
# - name: Use Node.js | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 16.x | |
# registry-url: https://registry.npmjs.org/ | |
# - name: set up JDK 11 | |
# uses: actions/setup-java@v1 | |
# with: | |
# java-version: 11.0.15 | |
# - name: Build it | |
# run: | | |
# yarn | |
# cd example | |
# yarn | |
# - name: run tests | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# with: | |
# api-level: 29 | |
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim | |
# script: yarn example run android |