From cf665a07dfdf14f8e0767155d6bce66af2be4ed6 Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Mon, 14 Nov 2022 10:36:42 +0100 Subject: [PATCH 1/3] Add tagged_release workflow --- .github/workflows/tagged_release.yaml | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/tagged_release.yaml diff --git a/.github/workflows/tagged_release.yaml b/.github/workflows/tagged_release.yaml new file mode 100644 index 0000000..7a01d50 --- /dev/null +++ b/.github/workflows/tagged_release.yaml @@ -0,0 +1,67 @@ +name: Create tagged release +on: + push: + tags: + - v*.*.* + +jobs: + build: + strategy: + matrix: + arch: [ "x64", "arm64" ] + runs-on: macos-11 + steps: + - name: Set up Git repository + uses: actions/checkout@v3 + - name: Set up node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install + run: npm install + - name: Build + run: npm run build -- -a ${{matrix.arch}} + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: permissions-${{matrix.arch}} + path: build/Release/permissions.node + + deploy: + needs: + - build + runs-on: macos-11 + steps: + - name: Set up Git repository + uses: actions/checkout@v3 + - name: Set up node + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + - name: Install + run: npm install + - name: Create directories + run: | + mkdir -p build/Release + mkdir -p /tmp/artifacts/x64 + mkdir -p /tmp/artifacts/arm64 + - name: Download x64 artifact + uses: actions/download-artifact@v3 + with: + name: permissions-x64 + path: /tmp/artifacts/x64 + - name: Download arm64 artifact + uses: actions/download-artifact@v3 + with: + name: permissions-arm64 + path: /tmp/artifacts/arm64 + - name: Build universal binary + run: | + lipo /tmp/artifacts/x64/permissions.node /tmp/artifacts/arm64/permissions.node -create -output build/Release/permissions.node + ls -la build/Release + lipo -info build/Release/permissions.node +# - name: Publish tagged release +# uses: JS-DevTools/npm-publish@v1 +# with: +# token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 0e808dd138019321bf99b01ab11283a73f65a1cb Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Mon, 14 Nov 2022 10:41:51 +0100 Subject: [PATCH 2/3] Skip building on install --- .github/workflows/tagged_release.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tagged_release.yaml b/.github/workflows/tagged_release.yaml index 7a01d50..1a37fe2 100644 --- a/.github/workflows/tagged_release.yaml +++ b/.github/workflows/tagged_release.yaml @@ -18,7 +18,7 @@ jobs: with: node-version: 18 - name: Install - run: npm install + run: npm install --ignore-scripts - name: Build run: npm run build -- -a ${{matrix.arch}} - name: Upload artifact @@ -40,7 +40,7 @@ jobs: node-version: 18 registry-url: 'https://registry.npmjs.org' - name: Install - run: npm install + run: npm install --ignore-scripts - name: Create directories run: | mkdir -p build/Release @@ -59,7 +59,6 @@ jobs: - name: Build universal binary run: | lipo /tmp/artifacts/x64/permissions.node /tmp/artifacts/arm64/permissions.node -create -output build/Release/permissions.node - ls -la build/Release lipo -info build/Release/permissions.node # - name: Publish tagged release # uses: JS-DevTools/npm-publish@v1 From f196c2b1c3eedcfedac832d731af4a78452c6609 Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Mon, 14 Nov 2022 10:46:24 +0100 Subject: [PATCH 3/3] Enable publish step --- .github/workflows/tagged_release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tagged_release.yaml b/.github/workflows/tagged_release.yaml index 1a37fe2..45e8e5d 100644 --- a/.github/workflows/tagged_release.yaml +++ b/.github/workflows/tagged_release.yaml @@ -60,7 +60,7 @@ jobs: run: | lipo /tmp/artifacts/x64/permissions.node /tmp/artifacts/arm64/permissions.node -create -output build/Release/permissions.node lipo -info build/Release/permissions.node -# - name: Publish tagged release -# uses: JS-DevTools/npm-publish@v1 -# with: -# token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + - name: Publish tagged release + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file