-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (93 loc) · 3.56 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
# branches: [ master ]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# 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
# Install ckanapi
- name: Install ckanapi client
run: sudo pip install ckanapi
- name: Install Node Dependecies
run: npm install
# Download JSON Export from CKAN
- name: Download JSON Export from CKAN
run: |
node --version
ls -l
echo ${GITHUB_RUN_NUMBER}
npm install
npm run download-groups
npm run download-organizations
# Generate Reports
- name: Generate ODT Reports from JSON
run: |
npm run process-groups
npm run process-organizations
- name: ZIP data-management-plan OTD files
run: |
zip --junk-paths -r data-management-plan ./output/*
- name: Upload data-management-plan build artifact
uses: actions/upload-artifact@v1
with:
name: data-management-plan
path: data-management-plan.zip
- name: Upload data-management-plan build artifacts
uses: actions/upload-artifact@v1
with:
name: output
path: ./output/
release:
name: release
needs: build
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Data Management Plan ${{ github.ref }}
body: |
Download the [CLARTIY H2020](https://myclimateservices.eu/) Data Management Plan generated by ${{ github.actor }} from [CLARITY CKAN](https://ckan.myclimateservice.eu/) meta-data catalogue [here](https://github.com/clarity-h2020/data-management-plan/releases/).
*Build #${{ github.run_number }} triggered by ${{ github.sha }}.*
draft: true
prerelease: true
- name: Download data-management-plan
uses: actions/download-artifact@v1
with:
name: data-management-plan
- name: Download data-management-plan
uses: actions/download-artifact@v1
with:
name: output
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # 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
asset_path: ./data-management-plan/data-management-plan.zip
asset_name: data-management-plan.zip
asset_content_type: application/zip
- name: Upload Assets to Release with a wildcard
uses: csexton/release-asset-action@v2
with:
pattern: "output/*"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ steps.create_release.outputs.upload_url }}