Repository navigation
Publish DPM component #1
This file contains hidden or 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 DPM component | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - uses: sbt/setup-sbt@v1 | |
| - name: Cache sbt | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.sbt | |
| ~/.ivy2/cache | |
| ~/.cache/coursier | |
| key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/*.sbt', 'project/build.properties') }} | |
| - name: Install DPM CLI | |
| run: | | |
| DPM_VERSION=1.0.21 | |
| curl -sSL "https://github.com/digital-asset/dpm/releases/download/${DPM_VERSION}/dpm-${DPM_VERSION}-linux-amd64.tar.gz" \ | |
| | tar -xz -C /tmp dpm | |
| sudo mv /tmp/dpm /usr/local/bin/dpm | |
| - name: Determine version | |
| id: version | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| V="${GITHUB_REF_NAME#v}" | |
| else | |
| V=$(grep -oE 'version := "[^"]+"' build.sbt | sed -E 's/.*"([^"]+)".*/\1/') | |
| fi | |
| echo "value=$V" >> "$GITHUB_OUTPUT" | |
| - name: Assemble fat JAR | |
| run: ./scripts/build-dpm-component.sh | |
| - name: Log in to GHCR | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Publish component to GHCR | |
| run: | | |
| dpm publish component \ | |
| "oci://ghcr.io/${{ github.repository_owner }}/daml-analyzer:${{ steps.version.outputs.value }}" \ | |
| --platform generic="./dpm-component" |