Skip to content

Commit

Permalink
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.
  • Loading branch information
gerph committed Sep 3, 2023
1 parent 9d0be0a commit 04db91f
Showing 1 changed file with 12 additions and 44 deletions.
56 changes: 12 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -53,16 +53,11 @@ jobs:
# use the non-commercial license.
sudo env PRINCEXML_I_HAVE_A_LICENSE=1 ./build.sh all
- 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:
Expand All @@ -72,58 +67,31 @@ 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

- 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 *
cd output
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:
Expand Down

0 comments on commit 04db91f

Please sign in to comment.