From c6b7db8d5969035fa888993ab7741c642a5547f3 Mon Sep 17 00:00:00 2001 From: tsosunchia <59512455+tsosunchia@users.noreply.github.com> Date: Wed, 25 Jan 2023 12:33:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3brew=E5=8C=85=E6=80=BB?= =?UTF-8?q?=E8=90=BD=E5=90=8Erelease=E4=B8=80=E4=B8=AA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20=E4=BB=A5=E5=90=8Epublishnewformu?= =?UTF-8?q?la=E9=9B=86=E6=88=90=E5=88=B0build=E4=B8=AD=EF=BC=8C=20publishn?= =?UTF-8?q?ewformula=E4=BF=9D=E7=95=99=EF=BC=8C=E4=BD=86=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 39 ++++++++++++++++++++++++- .github/workflows/publishNewFormula.yml | 5 ++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7f56c5..5aa96b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,4 +48,41 @@ jobs: dist/nexttrace_freebsd_amd64 dist/nexttrace_freebsd_arm64 env: - GITHUB_TOKEN: ${{ secrets.GT_Token }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GT_Token }} + + publish-new-formula: + needs: build + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: config git + run: | + git config --global user.email "${{ secrets.git_mail }}" + git config --global user.name "${{ secrets.git_name }}" + - name: Clone repo + run: | + git clone https://github.com/sjlleo/homebrew-nexttrace.git + - name: Exec scipt + run: | + cd homebrew-nexttrace + bash genFormula.sh + # - name: setup SSH keys and known_hosts + # run: | + # mkdir -p ~/.ssh + # ssh-keyscan github.com >> ~/.ssh/known_hosts + # ssh-agent -a $SSH_AUTH_SOCK > /dev/null + # ssh-add - <<< "${{ secrets.ID_RSA }}" + # env: + # SSH_AUTH_SOCK: /tmp/ssh_agent.sock + - name: Git Push + run: | + cd homebrew-nexttrace + git commit -am 'Publish a new version with Formula' || true + git remote set-url origin https://${{ secrets.gt_token }}@github.com/sjlleo/homebrew-nexttrace.git + git push + # env: + # SSH_AUTH_SOCK: /tmp/ssh_agent.sock + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/.github/workflows/publishNewFormula.yml b/.github/workflows/publishNewFormula.yml index 4896a19..972457b 100644 --- a/.github/workflows/publishNewFormula.yml +++ b/.github/workflows/publishNewFormula.yml @@ -3,7 +3,6 @@ name: Publish New Formula # Controls when the action will run. Workflow runs when manually triggered using the UI # or API. on: - push: workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -22,7 +21,7 @@ jobs: git config --global user.name "${{ secrets.git_name }}" - name: Clone repo run: | - git clone https://github.com/xgadget-lab/homebrew-nexttrace.git + git clone https://github.com/sjlleo/homebrew-nexttrace.git - name: Exec scipt run: | cd homebrew-nexttrace @@ -39,7 +38,7 @@ jobs: run: | cd homebrew-nexttrace git commit -am 'Publish a new version with Formula' || true - git remote set-url origin https://${{ secrets.gt_token }}@github.com/xgadget-lab/homebrew-nexttrace.git + git remote set-url origin https://${{ secrets.gt_token }}@github.com/sjlleo/homebrew-nexttrace.git git push # env: # SSH_AUTH_SOCK: /tmp/ssh_agent.sock