diff --git a/.github/actions/setvars/action.yml b/.github/actions/setvars/action.yml new file mode 100644 index 00000000..ee0cf98b --- /dev/null +++ b/.github/actions/setvars/action.yml @@ -0,0 +1,13 @@ +name: 'Set environment variables' +description: 'Configures environment variables for a workflow' +inputs: + varFilePath: + description: 'File path to variable file or directory. Defaults to ./.github/variables/* if none specified and runs against each file in that directory.' + required: false + default: ./.github/variables/* +runs: + using: "composite" + steps: + - run: | + sed "" ${{ inputs.varFilePath }} >> $GITHUB_ENV + shell: bash diff --git a/.github/variables/unity.env b/.github/variables/unity.env new file mode 100644 index 00000000..9c625960 --- /dev/null +++ b/.github/variables/unity.env @@ -0,0 +1,2 @@ +UNITY_HASH=577897200b8b +UNITY_FULL_VERSION=2021.3.20f1 diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 6f1e40c0..485de0e2 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -9,11 +9,7 @@ on: branches: - main - release/* - -env: - UNITY_HASH: 4016570cf34f - UNITY_FULL_VERSION: 2021.3.16f1 - + jobs: linux: runs-on: ubuntu-latest @@ -21,6 +17,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 + + - name: Set Environment Variables + uses: ./.github/actions/setvars + with: + varFilePath: ./.github/variables/unity.env - name: Setup .NET uses: actions/setup-dotnet@v1 diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 6fb3f876..18eac7e9 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -10,10 +10,6 @@ on: - main - release/* -env: - UNITY_HASH: 4016570cf34f - UNITY_FULL_VERSION: 2021.3.16f1 - jobs: macos: runs-on: macos-latest @@ -22,6 +18,11 @@ jobs: - name: Checkout uses: actions/checkout@v1 + - name: Set Environment Variables + uses: ./.github/actions/setvars + with: + varFilePath: ./.github/variables/unity.env + - name: Setup .NET uses: actions/setup-dotnet@v1 with: diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 950d3057..4c100932 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -10,10 +10,6 @@ on: - main - release/* -env: - UNITY_HASH: 4016570cf34f - UNITY_FULL_VERSION: 2021.3.16f1 - jobs: windows: runs-on: windows-latest @@ -22,6 +18,11 @@ jobs: - name: Checkout uses: actions/checkout@v1 + - name: Set Environment Variables + uses: ./.github/actions/setvars + with: + varFilePath: ./.github/variables/unity.env + - name: Setup .NET uses: actions/setup-dotnet@v1 with: