From 98fb5456108e0b6e6b2e3062b3e6cc169db989a5 Mon Sep 17 00:00:00 2001 From: Uraz Akgultan Date: Thu, 4 Jan 2024 14:39:13 +0100 Subject: [PATCH] fix: fix pipeline --- .github/workflows/Build.yml | 18 ++++-------------- .github/workflows/Release.yml | 18 ++++-------------- .../rollup-plugin-collect-dependencies.js | 3 ++- configs/jsactions/rollup.config.js | 10 ++++++++-- 4 files changed, 18 insertions(+), 31 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index c75cb1240..36a11d356 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -15,12 +15,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] steps: - name: "Checking changed files" id: files - uses: softprops/diffset@d5947696689a571f7a984a52505e2649eead5c22 # v1 + uses: softprops/diffset@db8c4e13f5cc3f8ab666ba2cb6998b688058a41c # v1 if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository with: base: main @@ -29,7 +29,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "Checking-out code" - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: "Fetching main to compare" @@ -44,20 +44,10 @@ jobs: id: variablesWindows run: echo "arg=$(If ('${{ steps.files.outputs.global_files }}' -eq '' -AND '${{ github.event_name == 'pull_request' }}' -eq 'true'){ echo '--since' } Else { echo '' })" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }} - name: "Defining node version" - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4 with: node-version-file: ".nvmrc" cache: "yarn" - - name: "Get yarn cache directory path" - id: yarn-cache-dir-path - run: echo "dir=$(yarn config get cacheFolder)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }} - - name: "Defining cache" - uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2 - env: - cache-name: cache-node-modules - with: - path: ${{ env.dir }} - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} - name: "Installing dependencies" run: yarn install - name: "Running build for development" diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 37f821120..0a05c3893 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -12,12 +12,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] steps: - name: "Checking changed files" id: files - uses: softprops/diffset@d5947696689a571f7a984a52505e2649eead5c22 # v1 + uses: softprops/diffset@db8c4e13f5cc3f8ab666ba2cb6998b688058a41c # v1 if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository with: base: main @@ -26,7 +26,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "Checking-out code" - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: "Fetching main to compare" @@ -41,20 +41,10 @@ jobs: id: variablesWindows run: echo "arg=$(If ('${{ steps.files.outputs.global_files }}' -eq '' -AND '${{ github.event_name == 'pull_request' }}' -eq 'true'){ echo '--since' } Else { echo '' })" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }} - name: "Defining node version" - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4 with: node-version-file: ".nvmrc" cache: "yarn" - - name: "Get yarn cache directory path" - id: yarn-cache-dir-path - run: echo "dir=$(yarn config get cacheFolder)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }} - - name: "Defining cache" - uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2 - env: - cache-name: cache-node-modules - with: - path: ${{ env.dir }} - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} - name: "Installing dependencies" run: yarn install - name: "Running release for production" diff --git a/configs/jsactions/rollup-plugin-collect-dependencies.js b/configs/jsactions/rollup-plugin-collect-dependencies.js index 82e055c13..e3ac7232c 100644 --- a/configs/jsactions/rollup-plugin-collect-dependencies.js +++ b/configs/jsactions/rollup-plugin-collect-dependencies.js @@ -177,7 +177,8 @@ async function copyJsModule(moduleSourcePath, to) { "!**/{android,ios,windows,mac,jest,github,gradle,__*__,docs,jest,example*}/**/*", "!**/*.{config,setup}.*", "!**/*.{podspec,flow}" - ] + ], + overwrite: true }); } diff --git a/configs/jsactions/rollup.config.js b/configs/jsactions/rollup.config.js index 2e1817312..b60176311 100644 --- a/configs/jsactions/rollup.config.js +++ b/configs/jsactions/rollup.config.js @@ -85,14 +85,20 @@ export default async args => { mkdirSync(path, { recursive: true }); await copyAsync( join(dirname(require.resolve("fbjs")), "lib", "invariant.js"), - join(path, "invariant.js") + join(path, "invariant.js"), + { + overwrite: true + } ); } else if (args.configProject === "nanoflowcommons") { // `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency. // https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13 await copyAsync( dirname(require.resolve("invariant")), - join(outDir, "node_modules", "invariant") + join(outDir, "node_modules", "invariant"), + { + overwrite: true + } ); }