diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 2cd5ab70..88e2cf03 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -5,6 +5,9 @@ on: branches: - main pull_request: + workflow_dispatch: + schedule: + - cron: "0 0 * * SUN" concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.ref }} @@ -66,3 +69,38 @@ jobs: run: | yarn yarn lint + + release: + name: Release + runs-on: ubuntu-latest + needs: [test, lint] + if: ${{ (github.ref == 'refs/heads/main') && (contains(fromJSON('["workflow_dispatch", "schedule"]'), github.event_name)) }} + + steps: + - name: Create GitHub App token 🔑 + id: create-app-token + uses: tibdex/github-app-token@v2.1.0 + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Node 💻 + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: yarn + + - name: Install dependencies 📦 + run: yarn + + - name: Release 🚀 + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }} + VSCE_PAT: ${{ secrets.VSCE_PAT }} diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml deleted file mode 100644 index 5a5b0f66..00000000 --- a/.github/workflows/semantic-release.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Semantic release - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * SUN" - -permissions: - contents: write - issues: write - pull-requests: write - -jobs: - semantic-release: - name: Semantic release - runs-on: ubuntu-latest - - steps: - - name: Create GitHub App token 🔑 - id: create-app-token - uses: tibdex/github-app-token@v2.1.0 - with: - app_id: ${{ secrets.GH_APP_ID }} - private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} - - - name: Checkout 🛎️ - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Setup Node 💻 - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: yarn - - - name: Install dependencies 📦 - run: yarn - - - name: Release 🚀 - run: npx semantic-release - env: - GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }} - VSCE_PAT: ${{ secrets.VSCE_PAT }}