generated from pds-data-dictionaries/ldd-template
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.41 KB
/
release-ldd.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
# 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@v4
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN || 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 "matrix={\"pds4_version\": $versions}" >> $GITHUB_OUTPUT
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@v4
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN || github.token }}
ssh-key: ${{ secrets.SSH_KEY }}
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Adding dependencies
run: |
sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev python3-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.ldd-manager
ldd-release --ingest_ldd_src_dir ${{github.workspace}}/src --ldd_output_path ${{ env.DEPLOY_PATH }} --token ${{ secrets.GITHUB_TOKEN }} --pds4_version ${{matrix.pds4_version}}