-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.57 KB
/
Copy pathrelease-ldd.yml
File metadata and controls
82 lines (68 loc) · 2.57 KB
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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
---
name: Release and Tag LDD Release
on:
push:
branches:
- 'main'
paths:
- 'build/release/**'
env:
DEPLOY_PATH: ${{ format('{0}/{1}', github.workspace, 'build/release') }}
# TODO - Have to hard-code this for now since Actions don't yet allow the use of env here.
LOGS_PATH: ${{ format('{0}/{1}', github.workspace, 'logs') }}
jobs:
get_versions:
name: Get Applicable PDS4 Versions
runs-on: ubuntu-latest
if: github.actor != 'pdsen-ci'
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
ssh-key: ${{ secrets.SSH_KEY }}
- id: set-matrix
run: |
while read -r line; do
if [[ ! -z "$line" ]]; then
versions=$versions'"'$line'"',
fi
done < $GITHUB_WORKSPACE/pds4_versions.txt
versions="[${versions::-1}]"
echo "{\"pds4_version\":${versions}}"
echo "::set-output name=matrix::{\"pds4_version\": $versions}"
build: # job 1
name: 'Tag and Release LDD'
needs: get_versions
runs-on: ubuntu-latest
if: github.actor != 'pdsen-ci'
strategy:
matrix: ${{fromJson(needs.get_versions.outputs.matrix)}}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
ssh-key: ${{ secrets.SSH_KEY }}
- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Adding dependencies
run: |
sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev python-libxml2
- name: Clean previous dev/snapshot tags
run: |
git fetch --prune --unshallow --tags
git tag -l | grep 'dev' | xargs -t -I arg sh -c 'git tag -d arg;git push --delete origin arg;'
- name: Publish new release
run: |
pip install pds-github-util
ldd-release --ingest_ldd_src_dir ${{github.workspace}}/src --ldd_output_path ${{ env.DEPLOY_PATH }} --token ${{ secrets.GITHUB_TOKEN }} --pds4_version ${{matrix.pds4_version}}
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
# branch: ${{ env.GITHUB_REF }}