Skip to content

Commit

Permalink
更换 CI DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
xrgzs committed Jun 3, 2024
1 parent 062c5f1 commit 775d85d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4


- name: Change DNS Server
shell: pwsh
run: |
$newDnsServers = @('1.1.1.1', '8.8.8.8')
$networkAdapters = Get-NetAdapter | Where-Object { $_.Status -eq 'Up' }
foreach ($adapter in $networkAdapters) {
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ResetServerAddresses
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses $newDnsServers
}
ipconfig /flushdns
- name: Generate version based on current date and time
id: generate_version
shell: pwsh
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4


- name: Change DNS Server
shell: pwsh
run: |
$newDnsServers = @('1.1.1.1', '8.8.8.8')
$networkAdapters = Get-NetAdapter | Where-Object { $_.Status -eq 'Up' }
foreach ($adapter in $networkAdapters) {
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ResetServerAddresses
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses $newDnsServers
}
ipconfig /flushdns
- name: Generate version based on current date and time
id: generate_version
shell: pwsh
Expand Down

0 comments on commit 775d85d

Please sign in to comment.