Skip to content

Commit

Permalink
Merge pull request #100 from pds-data-dictionaries/IM_release_1F00
Browse files Browse the repository at this point in the history
PDS4 IM Release 1F00
  • Loading branch information
thareUSGS authored Oct 31, 2020
2 parents 042e7cc + 374be8c commit 67c051a
Show file tree
Hide file tree
Showing 26 changed files with 98,263 additions and 24 deletions.
61 changes: 37 additions & 24 deletions .github/workflows/ldd-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# 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: LDD Automation with PDSEN CI Bot

on:
push:
branches:
Expand All @@ -17,32 +14,28 @@ on:
env:
REGRESSION_TEST_PATH: ${{ format('{0}/{1}/', github.workspace, 'test') }}
# TODO - Have to hard-code this for now since Actions don't yet allow the use of env here.
DEPLOY_PATH: ${{ format('{0}/{1}/{2}', github.workspace, 'build/development', github.sha) }}
LOGS_PATH: ${{ format('{0}/{1}', github.workspace, 'logs') }}
DEPLOY_PATH: ${{ format('{0}/{1}/{2}/{3}', github.workspace, 'build', 'development', github.sha) }}

jobs:
build: # job 1
name: 'LDD Build'
runs-on: ubuntu-latest
if: github.actor != 'pdsen-ci'

strategy:
matrix:
pds4_version: [ '1.14.0.0', '1.15.0.0' ]
# Example of how to specify multiple versions
# pds4_version: [ '1.13.0.0', '1.14.0.0' ]

include:
# include:
# Example of including older version with LDDTool dev version
- pds4_version: '1.14.0.0'
lddtool_development_release: True

# Example of include for development release of IM
- pds4_version: '1.15.0.0'
lddtool_development_release: True
pds4_development_release: True
# - pds4_version: '1.14.0.0'
# lddtool_development_release: True

steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- name: Set up Python 3
uses: actions/setup-python@v1
Expand All @@ -63,7 +56,7 @@ jobs:
lddtool_development_release: ${{ matrix.lddtool_development_release }}
test_path: ${{ env.REGRESSION_TEST_PATH }}
logs_path: ${{ env.LOGS_PATH }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- name: Upload LDDs to Github Action Artifacts
uses: actions/upload-artifact@v1
Expand All @@ -79,12 +72,21 @@ jobs:
path: ${{ env.LOGS_PATH }}
if: ${{ always() }}


upload: # job 2
name: 'Upload LDDs to Github'
name: 'Upload LDDs to Github Repo'
runs-on: ubuntu-latest
if: github.actor != 'pdsen-ci'

steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: '3.7'

- uses: actions/download-artifact@v2
with:
Expand All @@ -93,28 +95,39 @@ jobs:
- name: Display structure of downloaded files
run: ls -R /tmp/artifacts

- name: Clean out old LDDs
- name: Clean previous dev/snapshot tags
run: |
path=$(dirname ${{ env.DEPLOY_PATH }})
rm -fr $path/*
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: Move the LDDs to their new home
run: |
mkdir -p ${{ env.DEPLOY_PATH }}
mv /tmp/artifacts/*LDDs/* ${{ env.DEPLOY_PATH }}
cp -R /tmp/artifacts/*LDDs/* ${{ env.DEPLOY_PATH }}
- name: Display structure of downloaded files
run: ls -R ${{ env.DEPLOY_PATH }}

- name: Push LDDs to Github
- name: If Release Branch, move to release dir
shell: bash
run: |
if [[ "${{github.ref}}" == *"release"* ]]; then
echo "DEPLOY_PATH=${{github.workspace}}/build/release" >> $GITHUB_ENV
cp -R ${{ env.DEPLOY_PATH }}/* ${{github.workspace}}/build/release/
fi
- name: Push LDDs to Github
run: |
git config --local user.email "[email protected]"
git config --local user.name "PDSEN CI Bot"
git config --local github.token ${{ secrets.GITHUB_TOKEN }}
git add -A $(dirname ${{ env.DEPLOY_PATH }})
git commit -m "Auto-generated LDD by PDSEN CI Bot"
git config --global push.default current
git push
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
branch: ${{ github.ref }}

needs: build

54 changes: 54 additions & 0 deletions .github/workflows/release-ldd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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:
- 'master'
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:
build: # job 1
name: 'Tag and Release LDD'
runs-on: ubuntu-latest
if: github.actor != 'pdsen-ci'

steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- 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 }}
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
# branch: ${{ env.GITHUB_REF }}

Loading

0 comments on commit 67c051a

Please sign in to comment.