Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddOnTop committed Mar 6, 2024
1 parent 93c9e1f commit 0d7a8d9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Build
on:
push:
branches:
- master
- main
pull_request:
branches: [master]
branches: [main]
types: [opened, reopened, synchronize]
permissions:
contents: read
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -216,42 +216,42 @@ 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 }}
- name: Setup .npmrc file to publish to npm
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 }}
package: npm/@tailcallhq/core-${{matrix.build}}
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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0d7a8d9

Please sign in to comment.