1.20.1-guance #32
Workflow file for this run
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: Add assets to release | |
on: | |
release: | |
types: [published] | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
env: | |
TAG_NAME: ${{ github.event.release.tag_name }} | |
steps: | |
- name: Strip leading 'v' from tag and return as output | |
id: version_name | |
run: echo "version=$(echo ${TAG_NAME/#v/})" >> $GITHUB_OUTPUT | |
outputs: | |
ver: ${{ steps.version_name.outputs.version }} | |
test-and-set-version: | |
needs: get-version | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{needs.get-version.outputs.ver}} | |
VERSIONED_RELEASE: v${{needs.get-version.outputs.ver}} | |
RELEASE_ID: ${{github.event.release.id}} | |
steps: | |
- name: If release name is set and does not correspond correctly to tag (mismatch versioning in release name and tag), exit. | |
if: ${{ github.event.release.name != '' && github.event.release.name != env.VERSION && github.event.release.name != env.VERSIONED_RELEASE }} | |
run: | | |
echo "Failing job. Release name is invalid for this tag. Clear the contents of the Release Name field and retry." | |
exit 1 | |
- name: Update release name | |
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # 6.3.3 | |
with: | |
script: | | |
const VERSION = process.env.VERSION | |
const RELEASE_ID = process.env.RELEASE_ID | |
github.rest.repos.updateRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: `${RELEASE_ID}`, | |
name: `${VERSION}` | |
}) | |
dd-java-agent: | |
needs: [get-version, test-and-set-version] | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{needs.get-version.outputs.ver}} | |
steps: | |
- name: Download from Sonatype | |
run: | | |
wget https://oss.sonatype.org/service/local/repositories/releases/content/com/datadoghq/dd-java-agent/$VERSION/dd-java-agent-$VERSION.jar | |
cp dd-java-agent-$VERSION.jar dd-java-agent.jar | |
- name: Upload to release | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # 1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: dd-java-agent-${{ env.VERSION }}.jar | |
asset_name: dd-java-agent-${{ env.VERSION }}.jar | |
asset_content_type: application/java-archive | |
- name: Upload to release unversioned | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # 1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: dd-java-agent.jar | |
asset_name: dd-java-agent.jar | |
asset_content_type: application/java-archive | |
dd-trace-api: | |
needs: [get-version, test-and-set-version] | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{needs.get-version.outputs.ver}} | |
steps: | |
- name: Download from Sonatype | |
run: | | |
wget https://oss.sonatype.org/service/local/repositories/releases/content/com/datadoghq/dd-trace-api/$VERSION/dd-trace-api-$VERSION.jar | |
- name: Upload to release | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # 1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: dd-trace-api-${{ env.VERSION }}.jar | |
asset_name: dd-trace-api-${{ env.VERSION }}.jar | |
asset_content_type: application/java-archive | |
dd-trace-ot: | |
needs: [get-version, test-and-set-version] | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{needs.get-version.outputs.ver}} | |
steps: | |
- name: Download from Sonatype | |
run: | | |
wget https://oss.sonatype.org/service/local/repositories/releases/content/com/datadoghq/dd-trace-ot/$VERSION/dd-trace-ot-$VERSION.jar | |
- name: Upload to release | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # 1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: dd-trace-ot-${{ env.VERSION }}.jar | |
asset_name: dd-trace-ot-${{ env.VERSION }}.jar | |
asset_content_type: application/java-archive |