release #4
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: release | |
| on: | |
| push: | |
| tags: [ v* ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| NUGET_PACKAGES: ${{ github.workspace }}/packages | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| jobs: | |
| build-container: | |
| uses: ./.github/workflows/build-container.yml | |
| build-ubuntu1604-native: | |
| uses: ./.github/workflows/build-ubuntu1604-native-container.yml | |
| build: | |
| needs: build-ubuntu1604-native | |
| uses: ./.github/workflows/build.yml | |
| build-nuget-packages: | |
| needs: [ build, build-container ] | |
| uses: ./.github/workflows/build-nuget-packages.yml | |
| create-release: | |
| name: Create GitHub release | |
| runs-on: ubuntu-22.04 | |
| needs: [ build, build-container, build-nuget-packages ] | |
| permissions: | |
| attestations: write | |
| contents: write | |
| id-token: write | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # tag: v6.0.1 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # tag: v7.0.0 | |
| with: | |
| path: . | |
| - name: Install zip | |
| uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # tag: v1.0.0 | |
| - name: Create ZIP artifacts | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| packages=( | |
| "alpine-x64 linux-musl-x64" | |
| "alpine-arm64 linux-musl-arm64" | |
| "ubuntu-22.04 linux-glibc-x64" | |
| "ubuntu-22.04-arm linux-glibc-arm64" | |
| "windows-2022 windows" | |
| "macos-14 macos" | |
| "nuget-packages nuget-packages" | |
| ) | |
| for package in "${packages[@]}"; do | |
| read -r dir archive <<< "${package}" | |
| src="./bin-${dir}" | |
| (cd "${src}" && zip -qq -r "../opentelemetry-dotnet-instrumentation-${archive}.zip" ./* && cd ..) | |
| done | |
| - name: Collect install scripts | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| src="./installation-scripts-windows-2022" | |
| files=( | |
| "otel-dotnet-auto-install.sh" | |
| "OpenTelemetry.DotNet.Auto.psm1" | |
| ) | |
| for file in "${files[@]}"; do | |
| cp "${src}/${file}" "${file}" | |
| done | |
| rm -rf "${src}" | |
| - name: Generate checksums | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| artifacts=( | |
| "opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip" | |
| "opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip" | |
| "opentelemetry-dotnet-instrumentation-linux-musl-arm64.zip" | |
| "opentelemetry-dotnet-instrumentation-linux-musl-x64.zip" | |
| "opentelemetry-dotnet-instrumentation-macos.zip" | |
| "opentelemetry-dotnet-instrumentation-nuget-packages.zip" | |
| "opentelemetry-dotnet-instrumentation-windows.zip" | |
| "otel-dotnet-auto-install.sh" | |
| "OpenTelemetry.DotNet.Auto.psm1" | |
| ) | |
| for file in "${artifacts[@]}"; do | |
| sha256sum "${file}" >> "./checksums.txt" | |
| done | |
| echo "Verifying checksums" | |
| sha256sum "./checksums.txt" --check || exit 1 | |
| - name: Attest artifacts | |
| uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0 | |
| with: | |
| subject-path: | | |
| ./*.zip | |
| ./otel-dotnet-auto-install.sh | |
| ./OpenTelemetry.DotNet.Auto.psm1 | |
| ./checksums.txt | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: > | |
| gh release create "${GITHUB_REF_NAME}" --title "${GITHUB_REF_NAME}" --verify-tag --draft | |
| ./*.zip | |
| ./otel-dotnet-auto-install.sh | |
| ./OpenTelemetry.DotNet.Auto.psm1 | |
| ./checksums.txt |