Skip to content

Initial commit

Initial commit #1

Workflow file for this run

# 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}}