Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
package-feed generating
Browse files Browse the repository at this point in the history
  • Loading branch information
emyklebost committed Sep 14, 2021
1 parent a85a8ca commit 1ffc91b
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/MessagingCore-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 28 additions & 0 deletions .github/workflows/Update-package-feed.yml
Original file line number Diff line number Diff line change
@@ -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'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
**/_preprocessed
**/_genonce*
**/_updatePublisher*
**/*.jar
**/*.jar
package-feed.xml
4 changes: 4 additions & 0 deletions igs/MessagingCore/sushi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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. │
Expand Down
33 changes: 33 additions & 0 deletions package-feed.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:fhir="http://hl7.org/fhir/feed" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>NAV FHIR Packages</title>
<description>New Packages published by NAV</description>
<link>https://navikt.github.io/fhir/package-feed.xml</link>
<generator>HL7, Inc FHIR Publication tooling</generator>
<lastBuildDate>{{ "now" | date: "%a, %d %b %Y %H:%M:%S GMT" }}</lastBuildDate>
<atom:link href="https://navikt.github.io/fhir/package-feed.xml" rel="self" type="application/rss+xml"/>
<pubDate>{{ "now" | date: "%a, %d %b %Y %H:%M:%S GMT" }}</pubDate>
<language>en</language>
<ttl>600</ttl>
{%- for release in releases -%}
{%- assign package = release.assets | where: "name", "package.tgz" | first %}
<item>
<title>{{ release.tag_name | replace: "-", "#" }}</title>
<description/>
<link>{{ package.browser_download_url }}</link>
<guid isPermaLink="true">{{ package.browser_download_url }}</guid>
<dc:creator>NAV</dc:creator>
<fhir:version>4.0.1</fhir:version>
<fhir:kind>fhir.ig</fhir:kind>
<pubDate>{{ release.published_at | date: "%a, %d %b %Y %H:%M:%S GMT" }}</pubDate>
</item>
{%- endfor %}
</channel>
</rss>

0 comments on commit 1ffc91b

Please sign in to comment.