Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential github action smells #16508

Merged
merged 2 commits into from
May 28, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
52 changes: 32 additions & 20 deletions .github/workflows/uwp-autoconvert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- master

concurrency:
group: ${{github.workflow}} - ${{github.ref}}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UnoCheck_Version: '1.18.1'
Expand All @@ -23,7 +26,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0

Expand All @@ -32,40 +35,43 @@ jobs:
(Get-Content global.json).replace("latestFeature", "disable") | Set-Content global.json

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3
with:
global-json-file: global.json

- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
uses: gittools/actions/gitversion/setup@31b3198b2de324472547fecec2c0f721b70c38e2 # v0.9.15
with:
versionSpec: '5.10.3'

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.15
uses: gittools/actions/gitversion/execute@31b3198b2de324472547fecec2c0f721b70c38e2 # v0.9.15
with:
useConfigFile: true
configFilePath: gitversion.yml

- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: setup git username
run: git config user.name "GitHub Actions Bot"

- name: Setup git email
run: git config user.email "<>"

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # v1.1

- run: |
echo "JAVA_HOME=$env:JAVA_HOME_11_X64" >> $env:GITHUB_ENV
echo "JavaSdkDirectory=$env:JAVA_HOME_11_X64" >> $env:GITHUB_ENV
name: Select JDK 11
- run: echo "JAVA_HOME=$env:JAVA_HOME_11_X64" >> $env:GITHUB_ENV
name: Select JDK 11 (Java home)
jeromelaban marked this conversation as resolved.
Show resolved Hide resolved

- run: echo "JavaSdkDirectory=$env:JAVA_HOME_11_X64" >> $env:GITHUB_ENV
name: Select JDK 11 (Java sdk directory)

- run: |
& dotnet tool update --global uno.check --version $env:UnoCheck_Version --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest $env:UnoCheck_Manifest
name: Install .NET Workloads

- run: |
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest $env:UnoCheck_Manifest
name: Run uno-check
- name: Convert source tree to UWP
run: |
cd $env:GITHUB_WORKSPACE\src\Uno.WinUIRevert
Expand All @@ -75,11 +81,17 @@ jobs:
run: |
cd $env:GITHUB_WORKSPACE\build
msbuild Uno.UI.Build.csproj /v:m "/p:CombinedConfiguration=Release|AnyCPU" /m /t:RunAPISyncTool /bl
- name: Turn script debugging on
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: Set-PSDebug -Trace 1

- name: Stage all new/changed files
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: git add .

- name: Commit to repository
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
Set-PSDebug -Trace 1
git add .
git commit -m "Update UWP Autoconvert from $env:GITHUB_SHA"
git push origin $env:GITHUB_REF_NAME`:generated/$env:GITHUB_REF_NAME/uwp-autoconvert -f
run: git commit -a -m "Update UWP Autoconvert from $env:GITHUB_SHA"
Youssef1313 marked this conversation as resolved.
Show resolved Hide resolved
- name: Push to repository
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: git push origin $env:GITHUB_REF_NAME`:generated/$env:GITHUB_REF_NAME/uwp-autoconvert -f