From 97172466edeba9b99f823fc3ea32c8dedb32586b Mon Sep 17 00:00:00 2001 From: sjlleo Date: Sun, 12 Jun 2022 21:02:05 +0800 Subject: [PATCH] add: auto generate formula file with new tag --- .github/workflows/build.yml | 35 +++++++++++++++++++ .github/workflows/publishNewFormula.yml | 45 +++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/publishNewFormula.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07f0bd1..63dd95e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,3 +47,38 @@ jobs: dist/nexttrace_freebsd_arm64 env: GITHUB_TOKEN: ${{ secrets.GT_Token }} + publish-new-formula: + # 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/xgadget-lab/homebrew-nexttrace.git + - name: Exec scipt + run: | + cd homebrew-nexttrace-enhanced + 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' + git remote set-url origin https://${{ secrets.gt_token }}@github.com/xgadget-lab/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 new file mode 100644 index 0000000..1fc51cd --- /dev/null +++ b/.github/workflows/publishNewFormula.yml @@ -0,0 +1,45 @@ +name: Publish New Formula + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + publish-new-formula: + # 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/xgadget-lab/homebrew-nexttrace.git + - name: Exec scipt + run: | + cd homebrew-nexttrace-enhanced + 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' + git remote set-url origin https://${{ secrets.gt_token }}@github.com/xgadget-lab/homebrew-nexttrace.git + git push + # env: + # SSH_AUTH_SOCK: /tmp/ssh_agent.sock + - run: echo "🍏 This job's status is ${{ job.status }}."