APPS-2628 Add license file (#51) #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Snapshot Workflow | |
on: | |
push: | |
branches: | |
- develop | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
publish: | |
name: Publish Snapshot | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Install other dependencies | |
run: | | |
sudo apt update -y && sudo apt install -y jq | |
- name: Delete existing snapshot version | |
id: versions | |
run: | | |
version=`grep -o -P "\d+\.\d+\.\d+-SNAPSHOT" src/main/resources/application.conf` | |
if [ -z "$version" ]; then | |
echo "cwlScala version does not end in '-SNAPSHOT'; only snapshot versions are allowed in the develop branch" | |
exit 1 | |
fi | |
query="{\"query\": \"query { repository(owner:\\\"dnanexus\\\", name:\\\"cwlScala\\\") { packages(names:[\\\"com.dnanexus.cwlScala\\\"], first:1) { nodes { version(version:\\\"${version}\\\") { id } } } } }\" }" | |
version_json=`curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github.package-deletes-preview+json" \ | |
-H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-d "$query" \ | |
https://api.github.com/graphql` | |
version_id=`echo $version_json | jq -r .data.repository.packages.nodes[0].version.id` | |
echo ::set-output name=version_id::"${version_id}" | |
- name: Delete existing snapshot | |
uses: actions/delete-package-versions@v2 | |
if: ${{ steps.versions.outputs.version_id != 'null' }} | |
with: | |
repo: dnanexus | |
package-name: com.dnanexus.cwlScala | |
package-version-ids: ${{ steps.versions.outputs.version_id }} | |
- name: Build | |
run: | | |
# compile antlr4 sources | |
cd ${GITHUB_WORKSPACE} | |
make | |
- name: Publish Snapshot | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
sbt publish |