From 6fd8b0d1fbf28a9d33b0ed4c2e78759443e2c4e0 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Mon, 30 Dec 2024 10:56:49 -0300 Subject: [PATCH] refactor: update examples in readme (#725) --- .github/workflows/ci.yaml | 2 +- README.md | 89 ++++++++++++++++++++++++--------------- 2 files changed, 55 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b5de94b..31fe742 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ on: - next permissions: - contents: read + contents: read # for checkout jobs: test: diff --git a/README.md b/README.md index 75045c7..5be45fb 100644 --- a/README.md +++ b/README.md @@ -158,17 +158,26 @@ name: release on: push: - branches: [master] + branches: + - master + +permissions: + contents: read # for checkout jobs: release: runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 22 - run: npm ci + - run: npm audit signatures - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -228,13 +237,13 @@ jobs: 'semantic-release-vsce', { packageVsix: false, - publishPackagePath: '*/*.vsix', + publishPackagePath: '*.vsix', }, ], [ '@semantic-release/github', { - assets: '*/*.vsix', + assets: '*.vsix', }, ], ], @@ -251,7 +260,11 @@ name: ci on: push: - branches: [master] + branches: + - master + +permissions: + contents: read # for checkout jobs: build: @@ -276,6 +289,9 @@ jobs: - os: ubuntu-latest target: alpine-x64 npm_config_arch: x64 + - os: ubuntu-latest + target: alpine-arm64 + npm_config_arch: arm64 - os: macos-latest target: darwin-x64 npm_config_arch: x64 @@ -286,22 +302,18 @@ jobs: target: universal runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 - + node-version: 22 - if: matrix.target != 'universal' name: Install dependencies (with binaries) run: npm ci env: npm_config_arch: ${{ matrix.npm_config_arch }} - - if: matrix.target == 'universal' name: Install dependencies (without binaries) run: npm ci - - run: npx semantic-release --extends ./package.release.config.js env: VSCE_TARGET: ${{ matrix.target }} @@ -311,8 +323,7 @@ jobs: VSCE_PAT: ${{ secrets.VSCE_PAT }} # In case you want to publish to Open VSX Registry OVSX_PAT: ${{ secrets.OVSX_PAT }} - - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} path: '*.vsix' @@ -320,17 +331,20 @@ jobs: release: runs-on: ubuntu-latest needs: build + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: - node-version: 16 - + merge-multiple: true + - uses: actions/setup-node@v4 + with: + node-version: 22 - run: npm ci - - - uses: actions/download-artifact@v3 - + - run: npm audit signatures - run: npx semantic-release --extends ./publish.release.config.js env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -347,26 +361,31 @@ name: release on: push: - branches: [master] + branches: + - master + +permissions: + contents: read # for checkout jobs: release: runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm ci - - # Log into Azure CLI to get VSCE credentials - - name: Azure login - uses: azure/login@v2 + - uses: actions/checkout@v4 + - uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm ci + - run: npm audit signatures - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}