Skip to content

Publish NAV appliance release #35

Publish NAV appliance release

Publish NAV appliance release #35

Workflow file for this run

name: Publish NAV appliance release
on:
workflow_run:
workflows: ["Build NAV appliance"]
types:
- completed
jobs:
publish:
name: "Publish appliance as release"
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success'
&& github.event.workflow_run.head_repository.full_name == github.repository
permissions:
contents: write
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Download artifacts
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
done
- name: Publish artifacts as release
uses: ncipollo/release-action@v1
with:
artifacts: "navappliance.zip"
name: ${{ steps.date.outputs.date }}
body: "Automated build on ${{ steps.date.outputs.date }}, using latest available Debian packages"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: master