diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 629a0f5..c4ec28f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,9 @@ name: Build on: push: branches: - - master + - main pull_request: - branches: [master] + branches: [main] types: [opened, reopened, synchronize] permissions: contents: read @@ -59,7 +59,7 @@ jobs: draft_release: name: Draft Release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: contents: write @@ -89,7 +89,7 @@ jobs: name: Release needs: [test, draft_release, check_if_build, test_cf] # TODO: put a condition to separate job that other will depend on to remove duplication? - if: github.event_name == 'push' && github.ref == 'refs/heads/master' && (needs.check_if_build.outputs.check_if_build == 'true') + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && (needs.check_if_build.outputs.check_if_build == 'true') runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -216,20 +216,20 @@ jobs: args: ${{matrix.features}} --release --target ${{ matrix.target }} - name: Install Node.js - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') uses: actions/setup-node@v4 with: node-version: 20.11.0 registry-url: https://registry.npmjs.org - name: Install dependencies - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') run: | cd npm npm install - name: Run generate.js script - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') run: | cd npm npm run gen -- --target ${{matrix.target}} --version ${{ env.APP_VERSION }} --build ${{matrix.build}} --ext ${{ matrix.ext || '' }} --libc ${{ matrix.libc }} @@ -237,7 +237,7 @@ jobs: run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc - name: NPM Publish - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} @@ -245,13 +245,13 @@ jobs: access: public - name: Rename Binary with Target Name - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | pwd cp target/${{ matrix.target }}/release/tailcall${{ matrix.ext }} target/${{ matrix.target }}/release/tailcall-${{ matrix.target }}${{ matrix.ext }} - name: Upload ${{ matrix.target }} Binary - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: xresloader/upload-to-github-release@v1 with: release_id: ${{ needs.draft_release.outputs.create_release_id }} @@ -260,7 +260,7 @@ jobs: release_lambda: name: Release (AWS Lambda) needs: [test, draft_release, check_if_build, test_cf] - if: github.event_name == 'push' && github.ref == 'refs/heads/master' && (needs.check_if_build.outputs.check_if_build == 'true') + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && (needs.check_if_build.outputs.check_if_build == 'true') runs-on: ubuntu-latest permissions: contents: write @@ -303,7 +303,7 @@ jobs: overwrite: true semantic_release: name: Semantic Release - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') needs: [draft_release, release, release_lambda] runs-on: ubuntu-latest permissions: @@ -326,7 +326,7 @@ jobs: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }}/tc-server needs: [draft_release, release] - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') runs-on: ubuntu-latest # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. permissions: @@ -363,7 +363,7 @@ jobs: homebrew-release: name: Homebrew Release needs: [draft_release, release, semantic_release] - if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/master') + if: (startsWith(github.event.head_commit.message, 'feat') || startsWith(github.event.head_commit.message, 'fix')) && (github.event_name == 'push' && github.ref == 'refs/heads/main') permissions: contents: write pull-requests: write @@ -372,7 +372,7 @@ jobs: - uses: actions/checkout@v4 with: repository: tailcallhq/homebrew-tailcall - ref: master + ref: main token: ${{ secrets.HOMEBREW_ACCESS }} - name: Update Homebrew Formula