Skip to content

Commit

Permalink
ci: change github token (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBedard authored Sep 25, 2023
1 parent d92c343 commit afbb7ab
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,38 @@ jobs:
} else {
$Platforms += 'windows'
}
$Platforms | ForEach-Object {
$Runner = switch ($_) { 'windows' { 'windows-2022' } 'linux' { 'ubuntu-20.04' } }
foreach ($Arch in $Archs) {
$Jobs += @{
arch = $Arch
os = $_
$Jobs += @{
arch = $Arch
os = $_
runner = $Runner }
}
}
$GatewayMatrix = ConvertTo-JSON $Jobs -Compress
echo "gateway-build-matrix=$GatewayMatrix" >> $Env:GITHUB_OUTPUT
$Jobs = @()
$Archs += 'arm64'
$Platforms += 'macos'
$Platforms | ForEach-Object {
$Runner = switch ($_) { 'windows' { 'windows-2022' } 'macos' { 'macos-11' } 'linux' { 'ubuntu-20.04' } }
foreach ($Arch in $Archs) {
if ($Arch -Eq 'arm64' -And $_ -Eq 'linux') {
continue
}
$Jobs += @{
arch = $Arch
os = $_
$Jobs += @{
arch = $Arch
os = $_
runner = $Runner }
}
}
$JetsocatMatrix = ConvertTo-JSON $Jobs -Compress
echo "jetsocat-build-matrix=$JetsocatMatrix" >> $Env:GITHUB_OUTPUT
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
if: runner.os == 'macOS'
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.10'

- name: Configure macOS (arm) runner
if: matrix.os == 'macos' && matrix.arch == 'arm64'
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: Devolutions/actions
ref: master
ref: v1
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
path: ./.github/workflows

Expand All @@ -456,7 +456,7 @@ jobs:
- name: Install Devolutions Toolbox
uses: ./.github/workflows/toolbox-install
with:
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
github_token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}

## Download back the artifacts produced by the other jobs

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 9 additions & 9 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
id: get-commit
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_RUN: ${{ steps.get-run.outputs.run }}
run: |
$Ref = '${{ inputs.ref }}'
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
if: needs.preflight.outputs.dl-strategy == 'cli'
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$Destination = Join-Path ${{ runner.temp }} ${{ matrix.project }}
gh run download ${{ needs.preflight.outputs.run }} -n ${{ matrix.project }} -D "$Destination"
Expand All @@ -178,7 +178,7 @@ jobs:
run: |
$Destination = Join-Path ${{ runner.temp }} ${{ matrix.project }}
if ('${{ matrix.project }}' -Eq 'jetsocat') {
Get-ChildItem "$Destination" -Exclude ${{ matrix.os }} | Remove-Item -Recurse
Get-ChildItem "$Destination" -Exclude ${{ matrix.os }} | Remove-Item -Recurse
}
- name: Install AzureSignTool
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
AzureSignTool @Params $_.FullName
} elseif ('${{ matrix.os }}' -Eq 'macos') {
$SignCmd = $(@(
'codesign',
'codesign',
'--timestamp',
'--options=runtime',
'-s', '"Developer ID Application: Devolutions inc. (N592S9ASDB)"',
Expand Down Expand Up @@ -289,18 +289,18 @@ jobs:
run: |
$RootPath = Join-Path ${{ runner.temp }} ${{ matrix.project }} ${{ matrix.os }}
if ('${{ matrix.os }}' -Eq 'windows') {
Get-ChildItem -Path $RootPath -Recurse -Include ('*.exe', '*.msi') | % {
Get-ChildItem -Path $RootPath -Recurse -Include ('*.exe', '*.msi') | % {
signtool verify /pa "$($_.FullName)"
if ($LastExitCode -Ne 0) {
echo "::error::failed to verify the signature of $($_.FullName)"
echo "::error::failed to verify the signature of $($_.FullName)"
exit 1
}
}
} elseif ('${{ matrix.os }}' -Eq 'macos') {
Get-ChildItem -Path $RootPath -Recurse -Include 'jetsocat_*' | % {
Get-ChildItem -Path $RootPath -Recurse -Include 'jetsocat_*' | % {
codesign -dvvv "$($_.FullName)"
if ($LastExitCode -Ne 0) {
echo "::error::failed to verify the signature of $($_.FullName)"
echo "::error::failed to verify the signature of $($_.FullName)"
exit 1
}
}
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:
run: |
$Version = '${{ github.event.inputs.jetsocat-nuget-version }}'
if ([string]::IsNullOrWhitespace($Version)) {
$Version = Get-Date -Format "yyyy.M.d"
$Version = Get-Date -Format "yyyy.M.d"
}
$Nuspec = (Resolve-Path "Devolutions.Jetsocat.nuspec")
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
if: steps.get-dl-strategy.outputs.dl-strategy == 'cli'
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download ${{ steps.get-run.outputs.run }} -n version --repo $Env:GITHUB_REPOSITORY

- name: Get version
Expand All @@ -82,7 +82,7 @@ jobs:
id: check-release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$Output = (gh release list --repo $Env:GITHUB_REPOSITORY) | Out-String
$Releases = ( $Output -split '\r?\n' ).Trim()
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
if: needs.preflight.outputs.dl-strategy == 'cli'
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download ${{ needs.preflight.outputs.run }} -n docker -n devolutions-gateway --repo $Env:GITHUB_REPOSITORY

## workflow_call: The same artifacts persist across the entire run, so the PowerShell/DevolutionsGateway directory will still exist from the CI workflow
Expand Down Expand Up @@ -242,7 +242,7 @@ jobs:
if: needs.preflight.outputs.dl-strategy == 'cli'
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download ${{ needs.preflight.outputs.run }} -n jetsocat -n devolutions-gateway -n changelog --repo $Env:GITHUB_REPOSITORY

## workflow_call: The same artifacts persist across the entire run, so the PowerShell/DevolutionsGateway directory will still exist from the CI workflow
Expand All @@ -253,7 +253,7 @@ jobs:
- name: Create GitHub release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$Version = "${{ needs.preflight.outputs.version }}"
$HashPath = 'checksums'
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
if: needs.preflight.outputs.dl-strategy == 'cli'
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download ${{ needs.preflight.outputs.run }} -n devolutions-gateway --repo $Env:GITHUB_REPOSITORY

## workflow_call: The same artifacts persist across the entire run, so the PowerShell/DevolutionsGateway directory will still exist from the CI workflow
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: Devolutions/actions
ref: master
ref: v1
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
path: ./.github/workflows

Expand All @@ -360,7 +360,7 @@ jobs:
- name: Install Devolutions Toolbox
uses: ./.github/workflows/toolbox-install
with:
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
github_token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}

## Download back the artifacts produced by the other jobs

Expand All @@ -374,7 +374,7 @@ jobs:
if: needs.preflight.outputs.dl-strategy == 'cli'
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download ${{ needs.preflight.outputs.run }} -n devolutions-gateway --repo $Env:GITHUB_REPOSITORY

- name: Prepare upload
Expand All @@ -396,7 +396,7 @@ jobs:
if: needs.preflight.outputs.skip-publishing == 'false' && github.event.inputs.dry-run == 'false'
with:
client_id: ${{ secrets.ONEDRIVE_AUTOMATION_CLIENT_ID }}
client_secret: ${{ secrets.ONEDRIVE_AUTOMATION_CLIENT_SECRET }}
client_secret: ${{ secrets.ONEDRIVE_AUTOMATION_CLIENT_SECRET }}
remote: releases
destination_path: /Gateway/${{ steps.prepare.outputs.version }}
conflict_behavior: fail
Expand Down

0 comments on commit afbb7ab

Please sign in to comment.