Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the GitHub Actions workflow to use modern actions.
Browse files Browse the repository at this point in the history
Updated to use the modern actions and way of writing out the
variables to pass between steps.
gerph committed Sep 3, 2023
1 parent 9d0be0a commit aec9b59
Showing 1 changed file with 14 additions and 45 deletions.
59 changes: 14 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

@@ -51,18 +51,13 @@ jobs:
#
# These criteria are met by the builds we're creating here, and so we can
# use the non-commercial license.
sudo env PRINCEXML_I_HAVE_A_LICENSE=1 ./build.sh all
sudo env PRINCEXML_I_HAVE_A_LICENSE=1 ./build.sh prm
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: PRMinXML-Staging
path: output

- uses: actions/upload-artifact@v2
with:
name: Build-Logs
path: logs

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
@@ -72,66 +67,40 @@ jobs:
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
#if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download built documentation
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: PRMinXML-Staging
path: PRMinXML-Staging

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: Build the zip archive from the documentation
run: |
cd PRMinXML-Staging
zip -9r ../PRMinXML-Staging.zip *
zip -9r ../PRMinXML-Staging-${{ steps.get_version.outputs.VERSION }}.zip *
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.event.release.tag_name }}
draft: true
prerelease: false

- name: Upload full archive Assets
id: upload-asset-full
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`.
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PRMinXML-Staging.zip
asset_name: PRMinXML-Staging-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip

- name: Upload PDF only Asset
id: upload-asset-pdf
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`.
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PRMinXML-Staging/prm/RISCOS_PRM_Staging.pdf
asset_name: PRMinXML-Staging-${{ steps.get_version.outputs.VERSION }}.pdf
asset_content_type: application/pdf
draft: true
artifacts: "PRMinXML-Staging-${{ steps.get_version.outputs.VERSION }}.zip,PRMinXML-Staging/prm/RISCOS_PRM_Staging.pdf"
artifactContentType: application/zip

publish:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
#if: startsWith(github.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Deploy to GitHub Pages
id: deployment

0 comments on commit aec9b59

Please sign in to comment.