From 978da9e1d8c9b4b13c86c47dac683b8bfa8dc57e Mon Sep 17 00:00:00 2001 From: Andrea Settimi Date: Tue, 19 Nov 2024 17:01:10 +0100 Subject: [PATCH] WIP: tryin to fix ci for joss x11 --- .github/workflows/joss-pdf-build.yml | 116 +++++++++++++-------------- 1 file changed, 56 insertions(+), 60 deletions(-) diff --git a/.github/workflows/joss-pdf-build.yml b/.github/workflows/joss-pdf-build.yml index af559eabe..52c2c4a35 100644 --- a/.github/workflows/joss-pdf-build.yml +++ b/.github/workflows/joss-pdf-build.yml @@ -5,10 +5,6 @@ on: paths: - paper/** - .github/workflows/joss-pdf-build.yml - pull_request: - paths: - - paper/** - - .github/workflows/joss-pdf-build.yml jobs: paper-build: @@ -32,65 +28,65 @@ jobs: # paper.md path: paper/paper.pdf - # paper-commit: - # runs-on: ubuntu-latest - # name: add-pdf-to-repo - # needs: JOSS-paper-build - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # - name: Download - # uses: actions/download-artifact@v2 - # with: - # name: paper-artifact - # path: paper + paper-add-to-repo: + runs-on: ubuntu-latest + name: add-pdf-to-repo + needs: paper-build + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download + uses: actions/download-artifact@v2 + with: + name: paper-artifact + path: paper - # - name: Install GitHub CLI - # run: | - # choco install gh - # - name: Authenticate GitHub CLI - # run: | - # echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token + - name: Install GitHub CLI + run: | + choco install gh + - name: Authenticate GitHub CLI + run: | + echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token - # - name: Delete branch remotely version-ac-branch (if exists) - # run: | - # git fetch --prune - # if git branch -r | grep -q 'origin/version-ac-branch'; then - # git push origin --delete version-ac-branch - # else - # echo "Branch version-ac-branch does not exist." - # fi - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # shell: bash + - name: Delete branch remotely version-ac-branch (if exists) + run: | + git fetch --prune + if git branch -r | grep -q 'origin/version-ac-branch'; then + git push origin --delete version-ac-branch + else + echo "Branch version-ac-branch does not exist." + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash - # - name: Create new branch and commit version change - # run: | - # git config --global user.email "github-actions[bot]@users.noreply.github.com" - # git config --global user.name "github-actions[bot]" - # git checkout -b version-ac-branch - # git commit -am "ACTION_BOT: AC JOSS paper draft PDF" - # git push --set-upstream origin version-ac-branch - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create new branch and commit version change + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git checkout -b version-ac-branch + git commit -am "ACTION_BOT: AC JOSS paper draft PDF" + git push --set-upstream origin version-ac-branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Close existing pull requests for version-ac-branch - # run: | - # gh pr list --state open --head version-ac-branch --json number --jq '.[].number' | ForEach-Object { gh pr close $_ } - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # shell: pwsh + - name: Close existing pull requests for version-ac-branch + run: | + gh pr list --state open --head version-ac-branch --json number --jq '.[].number' | ForEach-Object { gh pr close $_ } + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: pwsh - # - name: Create pull request - # run: | - # gh pr create --title "ACTION_BOT: AC JOSS paper draft PDF" --body "AC JOSS paper draft PDF" --base main --head version-ac-branch --label ACTION_BOT - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create pull request + run: | + gh pr create --title "ACTION_BOT: AC JOSS paper draft PDF" --body "AC JOSS paper draft PDF" --base main --head version-ac-branch --label ACTION_BOT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Merge pull request - # run: | - # $pr = gh pr list --head version-ac-branch --json number --jq '.[0].number' - # gh pr merge $pr --squash --delete-branch --admin - # env: - # GITHUB_TOKEN: ${{ secrets.ADMIN_PAT_TOKEN }} - # shell: pwsh \ No newline at end of file + - name: Merge pull request + run: | + $pr = gh pr list --head version-ac-branch --json number --jq '.[0].number' + gh pr merge $pr --squash --delete-branch --admin + env: + GITHUB_TOKEN: ${{ secrets.ADMIN_PAT_TOKEN }} + shell: pwsh \ No newline at end of file