diff --git a/.github/delete-old-container-images/index.js b/.github/delete-old-container-images/index.js deleted file mode 100644 index fec4ab7..0000000 --- a/.github/delete-old-container-images/index.js +++ /dev/null @@ -1,49 +0,0 @@ -import { env } from 'process'; -import { Octokit } from "@octokit/core"; - -// Octokit.js -// https://github.com/octokit/core.js#readme -const octokit = new Octokit({ - auth: env.GITHUB_TOKEN -}) - -const common = { - package_type: 'container', - package_name: 'bililiverecorder', - org: env.GITHUB_REPOSITORY_OWNER, -} - -const packageInfo = await octokit.request('GET /orgs/{org}/packages/{package_type}/{package_name}', { - ...common, -}); - -const page_count = Math.ceil(packageInfo.data.version_count / 100); - -console.log(`共有 ${page_count} 页, ${packageInfo.data.version_count} 个版本`); - -const now = new Date(); - -for (let page = page_count; page > 0; page--) { - const versions = await octokit.request('GET /orgs/{org}/packages/{package_type}/{package_name}/versions', { - ...common, - per_page: 100, - page: page - }) - - const toBeDeleted = versions.data - .filter(x => (x.metadata?.container?.tags || []).length == 0) - .filter(x => !x.deleted_at) - .filter(x => (now - new Date(x.created_at)) > (1000 * 60 * 60 * 24 * 21)); // 21 天 - - console.log(`第 ${page} 页要删除 ${toBeDeleted.length} / ${versions.data.length} 个版本`); - - for (const version of toBeDeleted) { - - console.log(" 删除: " + version.id); - - await octokit.request('DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}', { - ...common, - package_version_id: version.id - }) - } -} diff --git a/.github/delete-old-container-images/package-lock.json b/.github/delete-old-container-images/package-lock.json deleted file mode 100644 index fe85d59..0000000 --- a/.github/delete-old-container-images/package-lock.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "name": "delete-old-container-images", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "dependencies": { - "@octokit/core": "^3.6.0" - } - }, - "node_modules/@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmmirror.com/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", - "dependencies": { - "@octokit/types": "^6.0.3" - } - }, - "node_modules/@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmmirror.com/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "dependencies": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmmirror.com/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "dependencies": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmmirror.com/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", - "dependencies": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/openapi-types": { - "version": "11.2.0", - "resolved": "https://registry.npmmirror.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", - "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" - }, - "node_modules/@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmmirror.com/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", - "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "dependencies": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "node_modules/@octokit/types": { - "version": "6.34.0", - "resolved": "https://registry.npmmirror.com/@octokit/types/-/types-6.34.0.tgz", - "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", - "dependencies": { - "@octokit/openapi-types": "^11.2.0" - } - }, - "node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmmirror.com/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" - }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmmirror.com/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - } - }, - "dependencies": { - "@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmmirror.com/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", - "requires": { - "@octokit/types": "^6.0.3" - } - }, - "@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmmirror.com/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "requires": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmmirror.com/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "requires": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmmirror.com/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", - "requires": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/openapi-types": { - "version": "11.2.0", - "resolved": "https://registry.npmmirror.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", - "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" - }, - "@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmmirror.com/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", - "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "requires": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/types": { - "version": "6.34.0", - "resolved": "https://registry.npmmirror.com/@octokit/types/-/types-6.34.0.tgz", - "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", - "requires": { - "@octokit/openapi-types": "^11.2.0" - } - }, - "before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmmirror.com/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmmirror.com/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - } - } -} diff --git a/.github/delete-old-container-images/package.json b/.github/delete-old-container-images/package.json deleted file mode 100644 index 27eca62..0000000 --- a/.github/delete-old-container-images/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "module", - "scripts": { - "delete": "ts-node index.ts" - }, - "dependencies": { - "@octokit/core": "^3.6.0" - } -} diff --git a/.github/delete-old-container-images/restore.js b/.github/delete-old-container-images/restore.js deleted file mode 100644 index fef2a94..0000000 --- a/.github/delete-old-container-images/restore.js +++ /dev/null @@ -1,66 +0,0 @@ -import { env } from 'process'; -import { Octokit } from "@octokit/core"; - -// Octokit.js -// https://github.com/octokit/core.js#readme -const octokit = new Octokit({ - auth: env.GITHUB_TOKEN -}) - -const common = { - package_type: 'container', - package_name: 'bililiverecorder', - org: env.GITHUB_REPOSITORY_OWNER, -} - - -const ids = [ - - -]; - -let inProgress = []; - -const restoredIds = []; - -function printAndEnd() { - console.log("Caught interrupt signal"); - console.log('================ ids:'); - console.log(JSON.stringify(ids)); - console.log('================ inProgress:'); - console.log(JSON.stringify(inProgress)); - console.log('================ restoredIds:'); - console.log(JSON.stringify(restoredIds)); - process.exit(); -} - -process.on('SIGINT', printAndEnd); - -async function start() { - while (ids.length > 0) { - const id = ids.pop(); - inProgress.push(id); - - await doRestore(id); - - inProgress = inProgress.filter(x => x != id); - restoredIds.push(id); - } -} - -async function doRestore(id) { - console.log(`R>: ${id} - ${new Date()}`); - const resp = await octokit.request('POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore', { - ...common, - package_version_id: id - }); - console.log(`OK: ${id} - ${new Date()}`); -} -try { - await Promise.all([start(), start(), start(), start(), start(), start()]); -} catch (error) { - console.error(error) - printAndEnd() -} - -printAndEnd() diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af9ce6f..15b4961 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,12 +22,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 - name: Make sure webui can be built if: "${{ matrix.os == 'windows-latest' }}" @@ -46,13 +46,13 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v1 - name: Restore Packages run: msbuild -t:restore /v:m BililiveRecorder.WPF/BililiveRecorder.WPF.csproj @@ -62,13 +62,13 @@ jobs: run: msbuild /nologo /v:m /p:Configuration="Release" BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Upload Artifacts - Debug - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: WPF-Debug path: BililiveRecorder.WPF/bin/Debug - name: Upload Artifacts - Release - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: WPF-Release path: BililiveRecorder.WPF/bin/Release @@ -81,12 +81,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 - name: Build WebUI run: ./webui/build.sh @@ -106,12 +106,12 @@ jobs: run: dotnet publish -c Release -r ${{ matrix.rid }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj - name: Upload Artifacts - Debug - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: CLI-${{ matrix.rid }}-Debug path: BililiveRecorder.Cli/publish/${{ matrix.rid }}/Debug - name: Upload Artifacts - Release - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: CLI-${{ matrix.rid }}-Release path: BililiveRecorder.Cli/publish/${{ matrix.rid }}/Release @@ -125,14 +125,14 @@ jobs: packages: write steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry if: github.event_name != 'pull_request' uses: docker/login-action@v2 @@ -145,7 +145,7 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: images: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -161,7 +161,7 @@ jobs: # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile.GitHubActions diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ae79e84..6b02f0f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,13 +30,13 @@ jobs: fetch-depth: 0 submodules: false # skip fetching webui, they are analyzed separately - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - queries: +security-extended,security-and-quality + queries: +security-extended - name: Build CLI if: ${{ matrix.language == 'csharp' }} diff --git a/.github/workflows/delete-old-container-images.yml b/.github/workflows/delete-old-container-images.yml deleted file mode 100644 index 87bf44b..0000000 --- a/.github/workflows/delete-old-container-images.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Delete old container images - -on: - workflow_dispatch: - schedule: - - cron: '33 23 * * 1,4' - -jobs: - run_script: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Run script - env: - GITHUB_TOKEN: ${{ secrets.DELETE_OLD_VERSION_ACCESS_TOKEN }} - run: cd .github/delete-old-container-images/ && npm ci && node index.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8469d35..3c9bc73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,12 +19,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 - name: Make sure webui can be built if: "${{ matrix.os == 'windows-latest' }}" @@ -46,23 +46,23 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v1 - name: Restore Packages run: msbuild -t:restore /v:m BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Build WPF run: msbuild /nologo /v:m /p:Configuration="${{ matrix.build_configuration }}" BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Upload Build Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: WPF-${{ matrix.build_configuration }} path: BililiveRecorder.WPF/bin/${{ matrix.build_configuration }} - name: Upload Packed Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: WPF-NupkgReleases path: BililiveRecorder.WPF/bin/NupkgReleases @@ -71,7 +71,7 @@ jobs: cd BililiveRecorder.WPF/bin/${{ matrix.build_configuration }} 7z a BililiveRecorder-WPF-Portable.zip . - name: Upload Portable Zip File - uses: actions/upload-release-asset@v1 + uses: actions/upload-release-asset@v1 # This action was deprecated, but it still works env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -89,12 +89,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 - name: Build WebUI run: ./webui/build.sh @@ -107,7 +107,7 @@ jobs: run: dotnet publish -c ${{ matrix.build_configuration }} -r ${{ matrix.rid }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: CLI-${{ matrix.rid }}-${{ matrix.build_configuration }} path: BililiveRecorder.Cli/publish/${{ matrix.rid }}/Release @@ -118,7 +118,7 @@ jobs: zip -r /tmp/CLI-${{ matrix.rid }}-${{ matrix.build_configuration }}.zip . - name: Upload Release Asset - uses: actions/upload-release-asset@v1 + uses: actions/upload-release-asset@v1 # This action was deprecated, but it still works env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -135,14 +135,14 @@ jobs: packages: write steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 # Login against a Docker registry except on PR # https://github.com/docker/login-action @@ -164,7 +164,7 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: images: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -181,7 +181,7 @@ jobs: # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile.GitHubActions