From 1ffc91b8b4b39bf4f7f82afea22e03a80b7a1ffe Mon Sep 17 00:00:00 2001 From: Eirik Date: Tue, 14 Sep 2021 11:21:31 +0200 Subject: [PATCH] package-feed generating --- .github/workflows/MessagingCore-release.yml | 2 ++ .github/workflows/Update-package-feed.yml | 28 +++++++++++++++++ .gitignore | 3 +- igs/MessagingCore/sushi-config.yaml | 4 +++ package-feed.liquid | 33 +++++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/Update-package-feed.yml create mode 100644 package-feed.liquid diff --git a/.github/workflows/MessagingCore-release.yml b/.github/workflows/MessagingCore-release.yml index d8e6fa5..0bb8392 100644 --- a/.github/workflows/MessagingCore-release.yml +++ b/.github/workflows/MessagingCore-release.yml @@ -76,6 +76,8 @@ jobs: name: ${{ env.IG }} v${{ steps.sushi_config.outputs.version }} tag_name: ${{ env.TAG }} body: ${{ steps.changelog.outputs.changes }} + draft: true + fail_on_unmatched_files: true files: | igs/${{ env.IG }}/output/full-ig.zip igs/${{ env.IG }}/output/package.tgz \ No newline at end of file diff --git a/.github/workflows/Update-package-feed.yml b/.github/workflows/Update-package-feed.yml new file mode 100644 index 0000000..6b62df6 --- /dev/null +++ b/.github/workflows/Update-package-feed.yml @@ -0,0 +1,28 @@ +name: Update package feed + +on: + release: + types: + - released + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Creates a new package-feed.xml from releases using the Liquid template. + - name: ๐Ÿ“ƒ Create package feed + run: | + npm install liquidjs + cat package-feed.liquid | npx liquidjs '{"releases":$(wget -q -O - https://api.github.com/repos/navikt/fhir/releases)}' > package-feed.xml + + # Publishes the generated package-feed.xml to a seperate branch in order to host it using GitHub-Pages. + # This will overwrite the currently published package-feed.xml. + - name: ๐Ÿš€ Deploy to GitHub-Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + exclude_assets: '**, !package-feed.xml' + commit_message: 'Updated package-feed.xml' \ No newline at end of file diff --git a/.gitignore b/.gitignore index feaab0b..58f3490 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ **/_preprocessed **/_genonce* **/_updatePublisher* -**/*.jar \ No newline at end of file +**/*.jar +package-feed.xml \ No newline at end of file diff --git a/igs/MessagingCore/sushi-config.yaml b/igs/MessagingCore/sushi-config.yaml index c2d12b8..8a891a2 100644 --- a/igs/MessagingCore/sushi-config.yaml +++ b/igs/MessagingCore/sushi-config.yaml @@ -5,11 +5,15 @@ id: nav.no.messaging.core.r4 canonical: http://fhir.nav.no name: MessagingCore +description: An IG containing the base messaging profiles. +homepage: https://github.com/navikt/fhir status: draft version: 0.1.0 fhirVersion: 4.0.1 copyrightYear: 2021+ releaseLabel: ci-build +publisher: + name: Norwegian Labour and Welfare Administration (NAV) # โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€menu.xmlโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ # โ”‚ To use a provided input/includes/menu.xml file, delete the "menu" property below. โ”‚ diff --git a/package-feed.liquid b/package-feed.liquid new file mode 100644 index 0000000..b15262f --- /dev/null +++ b/package-feed.liquid @@ -0,0 +1,33 @@ +{%- comment -%} + A Liquid Template used to transform json at https://api.github.com/repos/navikt/fhir/releases + into a FHIR Package RRS feed according to template http://hl7.org/fhir/package-feed.xml. + This is required to publish packages to the FHIR Package Registry: https://registry.fhir.org/submit + Bash command: + cat package-feed.liquid | npx liquidjs '{"releases":$(wget -q -O - https://api.github.com/repos/navikt/fhir/releases)}' > package-feed.xml +{%- endcomment -%} + + + NAV FHIR Packages + New Packages published by NAV + https://navikt.github.io/fhir/package-feed.xml + HL7, Inc FHIR Publication tooling + {{ "now" | date: "%a, %d %b %Y %H:%M:%S GMT" }} + + {{ "now" | date: "%a, %d %b %Y %H:%M:%S GMT" }} + en + 600 + {%- for release in releases -%} + {%- assign package = release.assets | where: "name", "package.tgz" | first %} + + {{ release.tag_name | replace: "-", "#" }} + + {{ package.browser_download_url }} + {{ package.browser_download_url }} + NAV + 4.0.1 + fhir.ig + {{ release.published_at | date: "%a, %d %b %Y %H:%M:%S GMT" }} + + {%- endfor %} + + \ No newline at end of file