Skip to content

Commit

Permalink
fixing typeos ++
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed May 17, 2024
1 parent 08979b8 commit a3f4242
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/publish_version_enforce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

env:
LABEL_PUBLISHED: 'release::published'
BUILD_LOC: "./build"
DOC_LOC: "./docs"

jobs:
build-release-content:
Expand Down Expand Up @@ -42,9 +44,26 @@ jobs:
with:
name: package
path: ${{ env.BUILD_LOC }}/abn.tar.gz

# NOTE: This should go the the r-container
- name: Install dependencies for pkgdown
run: |
install.packages(c("pkgdown"))
shell: Rscript {0}
- name: Build site
run: |
pkgdown::build_site_github_pages(dest_dir= "${{ env.DOC_LOC }}", new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload pkgdown artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ env.DOC_LOC }}/

publishing_release:
release-version:
# NOTE: Currently this workflow only runs if a release- branch has an open pull request
needs: build-release-content
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -63,9 +82,10 @@ jobs:
- name: Determine associated Pull request
id: get_pr
run: |
echo "PR=`echo $(gh pr list --json 'number,headRefName'|jq --arg NAME ${{ github.ref_name }} '.[] | select(.headRefName | contains($NAME)) | .number')`" >> $GITHUB_OUTPUT
echo "PR=`echo $(gh pr list --repo ${{ env.OWNER }}/${{ env.REPO }} --json 'number,headRefName'|jq --arg NAME ${{ github.ref_name }} '.[] | select(.headRefName | contains($NAME)) | .number')`" >> $GITHUB_OUTPUT
- name: Attempt to create label ${{ env.LABEL_PUBLISHED }}
if: ${{ steps.get_pr.outputs.pr }}
id: present_label
run: |
gh label create ${{ env.LABEL_PUBLISHED }} --repo ${{ env.OWNER }}/${{ env.REPO }}
continue-on-error: true # make sure the next steps run also on failure
Expand All @@ -89,7 +109,7 @@ jobs:
- name: Remove previous releases of the target tag, if existing # 2
if: ${{ (steps.published.outputs.labeled == 'false') && steps.get_pr.outputs.pr }}
run: |
if script -q -e -c "gh release view ${{ steps.release_version.outputs.version }}"; then
if script -q -e -c "gh release view ${{ steps.release_version.outputs.version }} --repo ${{ env.OWNER }}/${{ env.REPO }}"; then
# removing previous release along with associated tag
gh release delete ${{ steps.release_version.outputs.version }} \
--cleanup-tag -y \
Expand Down Expand Up @@ -117,12 +137,7 @@ jobs:
- name: Adding the label ${{ env.LABEL_PUBLISHED }} # 2
if: ${{ (steps.published.outputs.labeled == 'false') && steps.get_pr.outputs.pr }}
run: |
gh pr edit ${{ steps.get_pr.outputs.pr }} --add-label ${{ env.LABEL_PUBLISHED }}
shell: bash
- name: Adding the label ${{ env.LABEL_PUBLISHED }}
if: ${{ steps.published.outputs.labeled == 'false' }}
run: |
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_PUBLISHED }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ steps.get_pr.outputs.pr }} --add-label ${{ env.LABEL_PUBLISHED }} --repo ${{ env.OWNER }}/${{ env.REPO }}
shell: bash
- name: Get the built package
uses: actions/download-artifact@v4
Expand All @@ -135,3 +150,6 @@ jobs:
${{ env.BUILD_LOC }}/abn.tar.gz \
--clobber
--repo ${{ env.OWNER }}/${{ env.REPO }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
21 changes: 11 additions & 10 deletions .github/workflows/publish_version_merging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
run: |
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz')
shell: Rscript {0}
- name: Upload the built package as artifact
uses: actions/upload-artifact@v4
with:
name: package
path: ${{ env.BUILD_LOC }}/abn.tar.gz

# NOTE: This should go the the r-container
- name: Install dependencies for pkgdown
run: |
Expand All @@ -49,11 +55,6 @@ jobs:
shell: Rscript {0}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload the built package as artifact
uses: actions/upload-artifact@v4
with:
name: package
path: ${{ env.BUILD_LOC }}/abn.tar.gz
- name: Upload pkgdown artifact
uses: actions/upload-pages-artifact@v2
with:
Expand All @@ -62,15 +63,15 @@ jobs:
release-version:
needs: build-release-content
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
permissions:
contents: write
pull-requests: write
repository-projects: write
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:
- name: Remove previous releases of the target tag, if existing
if: ${{ steps.published.outputs.labeled == 'false' }}
run: |
if script -q -e -c "gh release view ${{ steps.release_version.outputs.version }}"; then
if script -q -e -c "gh release view ${{ steps.release_version.outputs.version }} --repo ${{ env.OWNER }}/${{ env.REPO }}"; then
# removing previous release along with associated tag
gh release delete ${{ steps.release_version.outputs.version }} \
--cleanup-tag -y \
Expand Down

0 comments on commit a3f4242

Please sign in to comment.