diff --git a/web/content/releases/_index.md b/web/content/releases/_index.md index cf429aa68854c5193d100874bf71b04bfb14bd93..95cff28b2d5876bf66c3cde64b7b8bea1d083a9e 100644 --- a/web/content/releases/_index.md +++ b/web/content/releases/_index.md @@ -1,3 +1,5 @@ +++ Title = "Releases" + +aliases = ["/downloads"] +++ diff --git a/web/layouts/section/releases.html b/web/layouts/section/releases.html index a911f10f5dea14c98cf11da748b64fcffee3048d..55622faffb38a6a768b51b1195bf878f5791a080 100644 --- a/web/layouts/section/releases.html +++ b/web/layouts/section/releases.html @@ -1,46 +1,75 @@ {{ define "main" }} - <h1>{{ .Title }}</h1> + <!-- <h1>{{ .Title }}</h1> --> {{ .Content }} {{ $urlPre := "https://api.github.com" }} {{ $releases := getJSON $urlPre "/repos/ufz/ogs/releases" }} - {{ $latest := index $releases 0 }} + {{ $latest := getJSON $urlPre "/repos/ufz/ogs/releases/latest" }} + {{ $statuses := getJSON $urlPre "/repos/ufz/ogs/commits/" $latest.tag_name "/statuses" }} <div class="note float-right border-r-4 border-l-0 ml-2"> - {{ $jenkinsBuildArtifacts := getJSON "https://jenkins.opengeosys.org/job/ufz/job/ogs/job/master/api/json?pretty=true&tree=builds[displayName,url,keepLog,artifacts[relativePath]]&xpath=/workflowJob/build[displayName='6.1.0']" }} - {{ $jenkinsReleaseArtifacts := where $jenkinsBuildArtifacts.builds "displayName" "==" $latest.tag_name }} - {{ range $index, $element := $jenkinsReleaseArtifacts }} - {{ $url := .url }} - <h3 class="border-b"><i class="fas fa-download"></i> Downloads</h3> - <ul class="list-reset text-sm"> - {{ range .artifacts }} - <li><a href="{{ $url }}artifact/{{ .relativePath }}"><i class="fas fa-archive"></i> {{ strings.TrimLeft "build/ogs-" .relativePath }}</a></li> + <h3 class="border-b"><i class="fas fa-download"></i> Downloads</h3> + <ul class="list-reset text-sm"> + {{ range $latest.assets }} + <li><a href="{{ .browser_download_url }}"><i class="fas fa-archive"></i> + {{ strings.TrimLeft (print "ogs-" $latest.tag_name) .name }}</a></li> + {{ end }} + <li> + <a href="https://github.com/ufz/ogs-data/archive/{{ $latest.tag_name }}.zip"> + <i class="fas fa-file"></i> Benchmark Input Files + </a> + </li> + </ul> + <h3 class="border-b">Links</h3> + <ul class="list-reset text-sm"> + {{ range first 1 (where (where $statuses ".state" "success") ".context" "continuous-integration/jenkins/branch") }} + <li><a href="{{ .target_url }}"><i class="fab fa-jenkins"></i> Jenkins Build</a></li> {{ end }} - <li><a href="{{ $url }}"><i class="fab fa-jenkins"></i> Jenkins Build</a></li> - </ul> - {{ end }} - </div> - <h2>Current Release: {{ $latest.tag_name }}</h2> + <li><a href="{{ $latest.html_url }}"><i class="fab fa-github"></i> GitHub Release</a></li> + </ul> + </div> + + <h2 class="mt-0">Current Release: {{ $latest.tag_name }}</h2> <div> - <i>{{ $latest.name }}</i> + {{ if not (eq $latest.tag_name $latest.name)}}<i>{{ $latest.name }}</i>{{ end }} <p>Released on {{ dateFormat "Monday, Jan 2, 2006" $latest.published_at }}</p> {{ $latest.body | markdownify }} </div> - <!-- TODO - - Tag ogs-data as well and link to corresponding data zip - - Jenkins Link to Artifacts on older release - - Downloads here or on own page? - --> + <h2><i class="fas fa-wrench"></i> Latest development version</h2> + {{ $head := getJSON $urlPre "/repos/ufz/ogs/git/refs/heads/master" }} + {{ $head_commit := getJSON $urlPre "/repos/ufz/ogs/commits/" $head.object.sha }} + {{ $head_statuses := getJSON $urlPre "/repos/ufz/ogs/commits/" $head.object.sha "/statuses" }} + + <p> + Here you can find the latest version of OpenGeoSys. But be warned: although this version was + successfully tested by the continuous integration system it may be unstable or incomplete... + </p> + + <div class="note"> + <h3>Commit Info</h3> + <p>{{ dateFormat "Monday, Jan 2, 2006" $head_commit.commit.author.date }} by + <a href="{{$head_commit.author.html_url }}">{{ $head_commit.commit.author.name }}</a>: + </p> + <p class="max-w-md"><i>{{ $head_commit.commit.message }}</i> <a href="{{ $head_commit.html_url }}"><i class="fab fa-github"></i> GitHub Commit Link</a></p> + <p> + {{ range first 1 (where $head_statuses ".context" "continuous-integration/jenkins/branch") }} + <a href="{{ .target_url }}"><i class="fab fa-jenkins"></i> Jenkins Build with Downloads</a> <span class="text-sm text-grey-dark">(Select the <i>Artifacts</i>-tab!)</span> + {{ end }} + </p> + </div> <h2>Older releases</h2> <ul> {{ range $index, $element := $releases }} {{ if not (eq $index 0) }} - {{ if not .draft }} - <li><a href="{{ .html_url }}" target="_blank">{{ .tag_name }}: {{ .name }}</a> - <!-- <br><p>{{ .body | truncate 200 | markdownify }}</p> --> + {{ if and (not .draft) (not .prerelease) }} + <li> + <a href="{{ .html_url }}" target="_blank"> + <i class="fab fa-github"></i> {{ .tag_name }} + </a> + {{ if not (eq .tag_name .name)}}: {{ .name }}{{ end }} </li> {{ end }} {{ end }}