From e79660547dce953ea6a2e1acd7f32b8fa2270e67 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 31 Aug 2022 10:21:18 +0200 Subject: [PATCH 1/3] fix: gh actions --- .github/actions/publish-test/action.yaml | 38 ++++++++++++++++++++++++ .github/workflows/package-tests.yml | 22 ++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/actions/publish-test/action.yaml create mode 100644 .github/workflows/package-tests.yml diff --git a/.github/actions/publish-test/action.yaml b/.github/actions/publish-test/action.yaml new file mode 100644 index 0000000000..31166c5b0b --- /dev/null +++ b/.github/actions/publish-test/action.yaml @@ -0,0 +1,38 @@ +name: 'Release NPM package' +description: 'Release NPM package' +inputs: + skip-build: + description: 'Skip build phase (useful for only configuration files)' + default: '' + filter: + description: 'Filter build phase by turbo' + default: '' + required: true + workdir: + description: 'Work directory for NPM publish' + default: '.' + required: true + token: + description: 'NPM Token' + default: 'null' + required: true +runs: + using: "composite" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - name: Install dependencies and build 🔧 + run: yarn install + shell: bash + - name: Build 🔧 + if: ${{ inputs.skip-build == '' }} + run: yarn build --filter ${{ inputs.filter }} + shell: bash + - name: Publish package on NPM 📦 + run: npm publish -w ${{ inputs.workdir }} --access public --dry-run + shell: bash + env: + NODE_AUTH_TOKEN: ${{ inputs.token }} \ No newline at end of file diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml new file mode 100644 index 0000000000..870188e893 --- /dev/null +++ b/.github/workflows/package-tests.yml @@ -0,0 +1,22 @@ +name: Asset Uploader +on: + push: + paths: + - "packages/**/*" + - ".github/workflows/package-tests.yml" + - ".github/actions/publish-test/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish-test + with: + workdir: ./packages/asset-uploader + filter: "@webstudio-is/asset-uploader" + token: ${{ secrets.NPM_TOKEN }} + - uses: ./.github/actions/publish-test + with: + workdir: ./packages/design-system + filter: "@webstudio-is/design-system" + token: ${{ secrets.NPM_TOKEN }} From e98742ae21fd0ac3cadbc3b12ee5b3fd9e7cdf2a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 31 Aug 2022 10:22:47 +0200 Subject: [PATCH 2/3] fix: gh actions --- .github/workflows/package-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml index 870188e893..cd0d865b87 100644 --- a/.github/workflows/package-tests.yml +++ b/.github/workflows/package-tests.yml @@ -6,7 +6,7 @@ on: - ".github/workflows/package-tests.yml" - ".github/actions/publish-test/action.yaml" jobs: - publish: + publish-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 97c1a45f7c6cba2943cea9dfeb952d1d437c20a3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 31 Aug 2022 10:27:28 +0200 Subject: [PATCH 3/3] fix: gh actions --- .github/workflows/package-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml index cd0d865b87..52ee02cfab 100644 --- a/.github/workflows/package-tests.yml +++ b/.github/workflows/package-tests.yml @@ -1,4 +1,4 @@ -name: Asset Uploader +name: Package tests (dry-run) on: push: paths: @@ -11,11 +11,13 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/publish-test + if: always() with: workdir: ./packages/asset-uploader filter: "@webstudio-is/asset-uploader" token: ${{ secrets.NPM_TOKEN }} - uses: ./.github/actions/publish-test + if: always() with: workdir: ./packages/design-system filter: "@webstudio-is/design-system"