Skip to content

Commit

Permalink
WIP: tryin to fix ci for joss x10
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Nov 19, 2024
1 parent b5ff56a commit e4191e8
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions .github/workflows/joss-pdf-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,65 +32,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-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

- 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
# - 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

0 comments on commit e4191e8

Please sign in to comment.