mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-09 00:24:09 +00:00
Merge pull request #346 from felixrieseberg/claude/crazy-kilby
Modernize GitHub Actions workflow
This commit is contained in:
47
.github/workflows/build.yml
vendored
47
.github/workflows/build.yml
vendored
@@ -12,25 +12,16 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
- name: Get yarn cache directory path
|
cache: npm
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: yarn --frozen-lockfile
|
run: npm ci
|
||||||
- name: lint
|
- name: lint
|
||||||
run: yarn lint
|
run: npm run lint
|
||||||
build:
|
build:
|
||||||
needs: lint
|
needs: lint
|
||||||
name: Build (${{ matrix.os }} - ${{ matrix.arch }})
|
name: Build (${{ matrix.os }} - ${{ matrix.arch }})
|
||||||
@@ -55,22 +46,12 @@ jobs:
|
|||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
- name: Get yarn cache directory path
|
cache: npm
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
if: matrix.os != 'macOS-latest'
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
- name: Set MacOS signing certs
|
- name: Set MacOS signing certs
|
||||||
if: matrix.os == 'macOS-latest'
|
if: matrix.os == 'macOS-latest'
|
||||||
run: chmod +x tools/add-macos-cert.sh && ./tools/add-macos-cert.sh
|
run: chmod +x tools/add-macos-cert.sh && ./tools/add-macos-cert.sh
|
||||||
@@ -81,7 +62,7 @@ jobs:
|
|||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
id: write_file
|
id: write_file
|
||||||
uses: timheuer/base64-to-file@v1
|
uses: timheuer/base64-to-file@784a1a4a994315802b7d8e2084e116e783d157be # v1.2.4
|
||||||
with:
|
with:
|
||||||
fileName: 'win-certificate.pfx'
|
fileName: 'win-certificate.pfx'
|
||||||
encodedString: ${{ secrets.WINDOWS_CODESIGN_P12 }}
|
encodedString: ${{ secrets.WINDOWS_CODESIGN_P12 }}
|
||||||
@@ -96,10 +77,10 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DISK_URL: ${{ secrets.DISK_URL }}
|
DISK_URL: ${{ secrets.DISK_URL }}
|
||||||
- name: Install
|
- name: Install
|
||||||
run: yarn
|
run: npm ci
|
||||||
- name: Make
|
- name: Make
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: yarn make --arch=${{ matrix.arch }}
|
run: npm run make -- --arch=${{ matrix.arch }}
|
||||||
env:
|
env:
|
||||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||||
@@ -107,7 +88,7 @@ jobs:
|
|||||||
WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }}
|
WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }}
|
||||||
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
|
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -15,9 +15,13 @@ async function main() {
|
|||||||
const response = await fetch(link, { method: 'HEAD' })
|
const response = await fetch(link, { method: 'HEAD' })
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
// If we're inside GitHub's release asset server, we just ran into AWS not allowing
|
// GitHub's release-asset and user-attachments CDNs reject anonymous HEAD
|
||||||
// HEAD requests, which is different from a 404.
|
// requests (403), which is different from a 404.
|
||||||
if (!response.url.startsWith('https://github-production-release-asset')) {
|
const isGithubCdn =
|
||||||
|
response.url.startsWith('https://github-production-release-asset') ||
|
||||||
|
response.url.startsWith('https://github-production-user-asset') ||
|
||||||
|
link.startsWith('https://github.com/user-attachments/')
|
||||||
|
if (!isGithubCdn) {
|
||||||
throw new Error (`HTTP Error Response: ${response.status} ${response.statusText}`)
|
throw new Error (`HTTP Error Response: ${response.status} ${response.statusText}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user