Skip to content

Merge pull request #54 from dnanexus/IT-8483-Remove-codeql.yml-workfl… #79

Merge pull request #54 from dnanexus/IT-8483-Remove-codeql.yml-workfl…

Merge pull request #54 from dnanexus/IT-8483-Remove-codeql.yml-workfl… #79

Workflow file for this run

name: Publish Snapshot Workflow
on:
push:
branches:
- develop
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
publish:
name: Publish Snapshot
runs-on: ubuntu-24.04
steps:
- name: Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install Java
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
- name: Install SBT
uses: ./.github/workflows/actions/install-sbt
- 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@000223ef3eaa3505c63d4c610f57ef103bcab46d # v2.0.2
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