From ecc83f3b0369ae6c94585d043128d2a6eb7435d3 Mon Sep 17 00:00:00 2001 From: weboko Date: Fri, 6 Jan 2023 00:42:28 +0100 Subject: [PATCH 1/4] add release_create_waku stage --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04782cb..ac663de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,3 +42,33 @@ jobs: - name: test run: npm run test --if-present working-directory: "examples/${{ matrix.example }}" + + release_create_waku: + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v2.3.3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_JS }} + - uses: bahmutov/npm-install@v1 + + - name: Build package + run: npm run build + work-directory: "create-waku-app" + + - name: Append git hash to version + shell: bash + run: | + CURR_VERSION=$(cat package.json | jq .version | tr -d '"') + GIT_HASH=$(git rev-parse --short HEAD) + cat package.json| jq --arg version "$CURR_VERSION-$GIT_HASH" '.version |= $version' > _package.json + mv -f _package.json package.json + work-directory: "create-waku-app" + + - name: Authenticate with registry + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ./.npmrc + work-directory: "create-waku-app" + + - run: npm publish --tag next --access public + work-directory: "create-waku-app" From 7fe118794fa603bdaaf1094dfdb4844553f3cd50 Mon Sep 17 00:00:00 2001 From: weboko Date: Fri, 6 Jan 2023 00:47:40 +0100 Subject: [PATCH 2/4] block release for failed examples stage --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac663de..0312ef1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: release_create_waku: runs-on: ubuntu-latest + needs: [examples_build_and_test] if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2.3.3 From 918c298826e0c4f041de5955f78e37eb881459e4 Mon Sep 17 00:00:00 2001 From: weboko Date: Fri, 20 Jan 2023 00:55:37 +0100 Subject: [PATCH 3/4] use WAKU_CREATE_APP_PUBLISH as a secret --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0312ef1..6b267ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: work-directory: "create-waku-app" - name: Authenticate with registry - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ./.npmrc + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.WAKU_CREATE_APP_PUBLISH }}" > ./.npmrc work-directory: "create-waku-app" - run: npm publish --tag next --access public From ba13190f2584da1a6aaba6fe23b610978bc02fcc Mon Sep 17 00:00:00 2001 From: weboko Date: Fri, 20 Jan 2023 01:40:03 +0100 Subject: [PATCH 4/4] fix typo --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b267ce..55f62f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - name: Build package run: npm run build - work-directory: "create-waku-app" + working-directory: "create-waku-app" - name: Append git hash to version shell: bash @@ -65,11 +65,11 @@ jobs: GIT_HASH=$(git rev-parse --short HEAD) cat package.json| jq --arg version "$CURR_VERSION-$GIT_HASH" '.version |= $version' > _package.json mv -f _package.json package.json - work-directory: "create-waku-app" + working-directory: "create-waku-app" - name: Authenticate with registry run: echo "//registry.npmjs.org/:_authToken=${{ secrets.WAKU_CREATE_APP_PUBLISH }}" > ./.npmrc - work-directory: "create-waku-app" + working-directory: "create-waku-app" - run: npm publish --tag next --access public - work-directory: "create-waku-app" + working-directory: "create-waku-app"