Skip to content

Revert "ci: use envs in GHAs and pin versions" #2189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 19 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ env:
LOWEST_SUPPORTED_UNITY_VERSION: 2019
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_SHA: ${{ github.sha }}
UNITY_VERSION: ${{ inputs.unity-version }}

defaults:
run:
Expand All @@ -24,19 +21,19 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@v3

- name: Checkout submodules
run: git submodule update --init --recursive src/sentry-dotnet

- name: Load env
id: env
run: echo "unityVersion=$(./scripts/ci-env.ps1 "unity${env:UNITY_VERSION}")" >> $env:GITHUB_OUTPUT
run: echo "unityVersion=$(./scripts/ci-env.ps1 "unity${{ inputs.unity-version }}")" >> $env:GITHUB_OUTPUT

- run: echo "::add-mask::${{ secrets.LICENSE_SERVER_URL }}"

- name: Restore Unity Packages
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
uses: actions/cache@v3
with:
path: |
samples/unity-of-bugs/Library/Packages
Expand All @@ -47,41 +44,41 @@ jobs:
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pinned v3
with:
registry: ghcr.io
username: ${{ env.GITHUB_ACTOR }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Start the Unity docker container
run: ./scripts/ci-docker.sh "${UNITY_VERSION}" 'ios' '${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}'
run: ./scripts/ci-docker.sh '${{ inputs.unity-version }}' 'ios' '${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}'
shell: bash

- name: Install .NET SDK
if: runner.os != 'Windows'
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
uses: actions/setup-dotnet@v4
with:
global-json-file: src/sentry-dotnet/global.json

- name: Install Android dotnet workflow
run: dotnet workload install android --temp-dir "${env:RUNNER_TEMP}"
run: dotnet workload install android --temp-dir "${{ runner.temp }}"

- name: Download CLI
run: ./scripts/download-sentry-cli.ps1

- name: Download Android SDK
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848
with:
name: Android-sdk
path: package-dev/Plugins/Android
wait-timeout: 3600

- name: Download Linux SDK
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848
with:
name: Linux-sdk
path: package-dev/Plugins/Linux
wait-timeout: 3600

- name: Download Windows SDK
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848
with:
name: Windows-sdk
path: package-dev/Plugins/Windows
Expand All @@ -100,16 +97,16 @@ jobs:
run: docker exec unity /home/gh/.dotnet/tools/assemblyalias --target-directory "package-dev/Runtime" --internalize --prefix "Sentry." --assemblies-to-alias "Microsoft*;System*"

- name: Package for release
if: ${{ env.UNITY_VERSION == env.LOWEST_SUPPORTED_UNITY_VERSION }}
if: ${{ inputs.unity-version == env.LOWEST_SUPPORTED_UNITY_VERSION }}
run: |
docker exec unity dotnet msbuild /t:UnityConfigureSentryOptions /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
./scripts/pack.ps1

- name: Upload release artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ env.UNITY_VERSION == env.LOWEST_SUPPORTED_UNITY_VERSION }}
uses: actions/upload-artifact@v4
if: ${{ inputs.unity-version == env.LOWEST_SUPPORTED_UNITY_VERSION }}
with:
name: ${{ env.GITHUB_SHA }}
name: ${{ github.sha }}
if-no-files-found: error
path: |
package-release.zip
Expand All @@ -120,16 +117,16 @@ jobs:
docker exec unity dotnet msbuild /t:UnityPlayModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Tests

- name: Upload test artifacts (playmode)
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@v4
with:
name: Test results (playmode) - ${{ env.UNITY_VERSION }}
name: Test results (playmode) - ${{inputs.unity-version}}
path: artifacts/test/playmode

- name: Run Unity tests (editmode)
run: docker exec unity dotnet msbuild /t:UnityEditModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Editor.Tests

- name: Upload test artifacts (editmode)
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@v4
with:
name: Test results (editmode) - ${{ env.UNITY_VERSION }}
name: Test results (editmode) - ${{inputs.unity-version}}
path: artifacts/test/editmode
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
uses: actions/checkout@v3

- name: Download UPM package
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848
with:
name: ${{ github.sha }}
wait-timeout: 3600
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
uses: actions/checkout@v3

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8 # v1.3.0
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8
with:
android: true
dotnet: false
Expand Down Expand Up @@ -149,18 +149,18 @@ jobs:
docker exec --user root unity apt-get -y -q install mono-devel

- name: Download IntegrationTest project
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
uses: actions/download-artifact@v4
with:
name: smoke-test-${{ matrix.unity-version }}

- name: Extract project archive
run: tar -xvzf test-project.tar.gz

# - name: Build without Sentry SDK
# run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${env:UNITY_PATH}" -Platform "${{ matrix.platform }}"
# run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform "${{ matrix.platform }}"

- name: Download UPM package
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848
with:
name: ${{ github.sha }}
wait-timeout: 3600
Expand All @@ -187,7 +187,7 @@ jobs:

# Upload runtime initialization build
- name: Upload test app
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@v4
with:
name: testapp-${{ matrix.platform }}-${{ matrix.unity-version }}-runtime
if-no-files-found: error
Expand All @@ -196,7 +196,7 @@ jobs:

- name: Upload IntegrationTest project on failure
if: ${{ failure() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@v4
with:
name: failed-project-${{ matrix.platform }}-${{ matrix.unity-version }}
path: |
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
uses: actions/checkout@v3

- name: Download test app artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
uses: actions/download-artifact@v4
id: download
with:
name: testapp-${{ matrix.platform }}-${{ matrix.unity-version }}-runtime
Expand Down Expand Up @@ -345,7 +345,7 @@ jobs:
# unity-config-path: /Library/Application Support/Unity/config/
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@v3

- name: Load env
id: env
Expand All @@ -365,18 +365,18 @@ jobs:
Set-Content -Path '${{ matrix.unity-config-path }}services-config.json' -Value '${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}'

- name: Download IntegrationTest project
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
uses: actions/download-artifact@v4
with:
name: smoke-test-${{ matrix.unity-version }}

- name: Extract project archive
run: tar -xvzf test-project.tar.gz

- name: Build without Sentry SDK
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${env:UNITY_PATH}"
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}"

- name: Download UPM package
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@v3
with:
submodules: recursive

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

- name: Check out current commit (${{ github.sha }})
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@v3
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0

- name: Prepare release ${{ github.event.inputs.version }}
uses: getsentry/action-prepare-release@3cea80dc3938c0baf5ec4ce752ecb311f8780cdc # v1
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ on:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
TARGET: ${{ inputs.target }}
CONTAINER: ${{ inputs.container }}
RUNS_ON: ${{ inputs.runsOn }}

jobs:
build:
runs-on: ${{ env.RUNS_ON }}
container: ${{ env.CONTAINER }}
runs-on: ${{ inputs.runsOn }}
container: ${{ inputs.container }}
timeout-minutes: 30
steps:
- name: Set up Git in container
if: ${{ env.CONTAINER != '' }}
if: ${{ inputs.container != '' }}
# ubuntu:20.04 does not have git installed by default. Make it available
# for actions/checkout to get a proper clone instead of downloading a
# tarball using the GitHub REST API. This ensures that git submodule
Expand All @@ -43,13 +40,13 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive

- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: actions/checkout@v3

- name: Select submodules
id: env
shell: bash
run: |
if [[ "${TARGET}" == "Android" ]]; then
if [[ "${{ inputs.target }}" == "Android" ]]; then
submodules="modules/sentry-java"
else
submodules="modules/sentry-native"
Expand All @@ -61,22 +58,22 @@ jobs:
- name: Get submodule status
run: git submodule status --cached ${{ steps.env.outputs.submodules }} | tee submodules-status

- run: cp -r package-dev/Plugins/${TARGET} sdk-static || echo "never mind, no files checked in..."
- run: cp -r package-dev/Plugins/${{ inputs.target }} sdk-static || echo "never mind, no files checked in..."
shell: bash

- name: Restore from cache
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
uses: actions/cache@v3
id: cache
with:
# Note: native SDKs are cached and only built if the respective 'package-dev/Plugins/' directories are empty.
# Output changes only depending on the git sha of the submodules
# hash of package/package.json for cache busting on release builds (version bump)
path: |
package-dev/Plugins
key: sdk=${{ env.TARGET }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'sdk-static/**') }}
key: sdk=${{ inputs.target }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'sdk-static/**') }}

- name: Installing Linux Dependencies
if: ${{ env.TARGET == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
if: ${{ inputs.target == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
apt-get update
Expand All @@ -91,19 +88,19 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
git submodule update --init --recursive ${{ steps.env.outputs.submodules }}
dotnet msbuild /t:Build${TARGET}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
dotnet msbuild /t:Build${{ inputs.target }}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity

- name: Upload build logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@v4
with:
path: ${{ steps.env.outputs.submodulesPath }}/build.log
# Lower retention period - we only need this to retry CI.
retention-days: 14

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- uses: actions/upload-artifact@v4
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/${{ env.TARGET }}
name: ${{ inputs.target }}-sdk
path: package-dev/Plugins/${{ inputs.target }}
# Lower retention period - we only need this to retry CI.
retention-days: 14
Loading
Loading