Fix github actions to specific commit hashes
This commit is contained in:
2
.github/workflows/backport.yml
vendored
2
.github/workflows/backport.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
||||||
repository: signalapp/Signal-Backport-Action-Private
|
repository: signalapp/Signal-Backport-Action-Private
|
||||||
|
16
.github/workflows/benchmark.yml
vendored
16
.github/workflows/benchmark.yml
vendored
@@ -25,27 +25,27 @@ jobs:
|
|||||||
run: uname -a
|
run: uname -a
|
||||||
|
|
||||||
- name: Clone Desktop repo
|
- name: Clone Desktop repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
id: cache-sccache
|
id: cache-sccache
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
@@ -201,13 +201,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload benchmark logs on failure
|
- name: Upload benchmark logs on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||||
with:
|
with:
|
||||||
name: logs
|
name: logs
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Clone benchmark repo
|
- name: Clone benchmark repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
repository: 'signalapp/Signal-Desktop-Benchmarks-Private'
|
repository: 'signalapp/Signal-Desktop-Benchmarks-Private'
|
||||||
path: 'benchmark-results'
|
path: 'benchmark-results'
|
||||||
|
96
.github/workflows/ci.yml
vendored
96
.github/workflows/ci.yml
vendored
@@ -18,31 +18,31 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- run: lsb_release -a
|
- run: lsb_release -a
|
||||||
- run: uname -a
|
- run: uname -a
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
||||||
|
|
||||||
- name: Restore cached .eslintcache and tsconfig.tsbuildinfo
|
- name: Restore cached .eslintcache and tsconfig.tsbuildinfo
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
id: cache-lint
|
id: cache-lint
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
- run: git diff --exit-code
|
- run: git diff --exit-code
|
||||||
|
|
||||||
- name: Update cached .eslintcache and tsconfig.tsbuildinfo
|
- name: Update cached .eslintcache and tsconfig.tsbuildinfo
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -87,25 +87,25 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: uname -a
|
- run: uname -a
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
||||||
@@ -149,7 +149,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifacts on failure
|
- name: Upload artifacts on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
@@ -161,17 +161,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- run: lsb_release -a
|
- run: lsb_release -a
|
||||||
- run: uname -a
|
- run: uname -a
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
@@ -180,9 +180,9 @@ jobs:
|
|||||||
run: sudo apt-get install xvfb libpulse0 || (sudo apt-get update && sudo apt-get install xvfb libpulse0)
|
run: sudo apt-get install xvfb libpulse0 || (sudo apt-get update && sudo apt-get install xvfb libpulse0)
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
||||||
@@ -231,7 +231,7 @@ jobs:
|
|||||||
- run: xvfb-run --auto-servernum pnpm run test-node
|
- run: xvfb-run --auto-servernum pnpm run test-node
|
||||||
|
|
||||||
- name: Clone backup integration tests
|
- name: Clone backup integration tests
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
repository: 'signalapp/Signal-Message-Backup-Tests'
|
repository: 'signalapp/Signal-Message-Backup-Tests'
|
||||||
ref: 'a743fbf8e3adc2f1a700577dd8a470beff60db3f'
|
ref: 'a743fbf8e3adc2f1a700577dd8a470beff60db3f'
|
||||||
@@ -251,7 +251,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifacts on failure
|
- name: Upload artifacts on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
@@ -260,44 +260,28 @@ jobs:
|
|||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86\\store\\references\\"
|
|
||||||
SDK_LOCATION: "C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.17134.0"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: systeminfo
|
- run: systeminfo
|
||||||
- run: git config --global core.autocrlf false
|
- run: git config --global core.autocrlf false
|
||||||
- run: git config --global core.eol lf
|
- run: git config --global core.eol lf
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'pnpm'
|
||||||
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}\.electron-gyp
|
path: ${{ env.SCCACHE_PATH }}\.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
|
||||||
- run: pnpm install -g node-gyp@10.0.1
|
- run: pnpm install -g node-gyp@10.0.1
|
||||||
|
|
||||||
# Set things up so @nodert-win10-rs4 dependencies build properly
|
|
||||||
- run: dir "$env:BUILD_LOCATION"
|
|
||||||
- run: dir "$env:SDK_LOCATION"
|
|
||||||
- run: "copy \"$env:BUILD_LOCATION\\platform.winmd\" \"$env:SDK_LOCATION\""
|
|
||||||
- run: dir "$env:SDK_LOCATION"
|
|
||||||
|
|
||||||
- name: Cache Desktop node_modules
|
|
||||||
id: cache-desktop-modules
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: node_modules
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
|
||||||
|
|
||||||
- name: Install Desktop node_modules
|
- name: Install Desktop node_modules
|
||||||
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
env:
|
env:
|
||||||
CHILD_CONCURRENCY: 1
|
CHILD_CONCURRENCY: 1
|
||||||
@@ -344,7 +328,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifacts on failure
|
- name: Upload artifacts on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
@@ -358,11 +342,11 @@ jobs:
|
|||||||
working-directory: sticker-creator
|
working-directory: sticker-creator
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
@@ -397,18 +381,18 @@ jobs:
|
|||||||
run: uname -a
|
run: uname -a
|
||||||
|
|
||||||
- name: Clone Desktop repo
|
- name: Clone Desktop repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
@@ -417,9 +401,9 @@ jobs:
|
|||||||
run: sudo apt-get install xvfb libpulse0 || (sudo apt-get update && sudo apt-get install xvfb libpulse0)
|
run: sudo apt-get install xvfb libpulse0 || (sudo apt-get update && sudo apt-get install xvfb libpulse0)
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }}
|
||||||
@@ -453,7 +437,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload mock server test logs on failure
|
- name: Upload mock server test logs on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||||
with:
|
with:
|
||||||
name: logs
|
name: logs
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
6
.github/workflows/danger.yml
vendored
6
.github/workflows/danger.yml
vendored
@@ -10,13 +10,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # fetch all history
|
fetch-depth: 0 # fetch all history
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
- name: Install danger node_modules
|
- name: Install danger node_modules
|
||||||
|
14
.github/workflows/icu-book.yml
vendored
14
.github/workflows/icu-book.yml
vendored
@@ -13,25 +13,25 @@ jobs:
|
|||||||
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
|
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
id: cache-sccache
|
id: cache-sccache
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
- run: pnpm run build:esbuild
|
- run: pnpm run build:esbuild
|
||||||
- run: node ts/scripts/compile-stories-icu-lookup.js stories
|
- run: node ts/scripts/compile-stories-icu-lookup.js stories
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||||
with:
|
with:
|
||||||
name: desktop-${{ github.ref_name }}-icu
|
name: desktop-${{ github.ref_name }}-icu
|
||||||
path: stories
|
path: stories
|
||||||
|
2
.github/workflows/notes.yml
vendored
2
.github/workflows/notes.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
||||||
repository: signalapp/Signal-Notes-Action-Private
|
repository: signalapp/Signal-Notes-Action-Private
|
||||||
|
2
.github/workflows/release-notes.yml
vendored
2
.github/workflows/release-notes.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
token: ${{ secrets.AUTOMATED_GITHUB_PAT }}
|
||||||
repository: signalapp/Signal-Release-Notes-Action-Private
|
repository: signalapp/Signal-Release-Notes-Action-Private
|
||||||
|
12
.github/workflows/stories.yml
vendored
12
.github/workflows/stories.yml
vendored
@@ -13,25 +13,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest-8-cores
|
runs-on: ubuntu-latest-8-cores
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
- name: Setup node.js
|
- name: Setup node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'pnpm-lock.yaml'
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- name: Cache .electron-gyp
|
- name: Cache .electron-gyp
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
with:
|
with:
|
||||||
path: ~/.electron-gyp
|
path: ~/.electron-gyp
|
||||||
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.7
|
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
|
||||||
- name: Restore sccache
|
- name: Restore sccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
|
||||||
id: cache-sccache
|
id: cache-sccache
|
||||||
with:
|
with:
|
||||||
path: ${{ env.SCCACHE_PATH }}
|
path: ${{ env.SCCACHE_PATH }}
|
||||||
|
117
ts/scripts/update-gha.ts
Normal file
117
ts/scripts/update-gha.ts
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// Copyright 2025 Signal Messenger, LLC
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import { readFile, readdir, writeFile } from 'node:fs/promises';
|
||||||
|
import z from 'zod';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
|
import { drop } from '../util/drop';
|
||||||
|
import { strictAssert } from '../util/assert';
|
||||||
|
|
||||||
|
const { GITHUB_TOKEN } = process.env;
|
||||||
|
|
||||||
|
const WORKFLOWS_DIR = join(__dirname, '..', '..', '.github', 'workflows');
|
||||||
|
|
||||||
|
const REGEXP =
|
||||||
|
/uses:\s*(?<path>[^\s]+)@(?<ref>[^\s#]+)(?:\s*#\s*(?<originalRef>[^\n]+))?/g;
|
||||||
|
|
||||||
|
const CACHE = new Map<string, string>();
|
||||||
|
|
||||||
|
const TagsSchema = z
|
||||||
|
.object({
|
||||||
|
name: z.string(),
|
||||||
|
commit: z.object({
|
||||||
|
sha: z.string(),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.array();
|
||||||
|
|
||||||
|
async function updateAction(fullPath: string): Promise<void> {
|
||||||
|
const source = await readFile(fullPath, 'utf8');
|
||||||
|
|
||||||
|
for (const { groups } of source.matchAll(REGEXP)) {
|
||||||
|
strictAssert(groups != null, 'Expected regexp to fully match');
|
||||||
|
const { path, ref, originalRef } = groups;
|
||||||
|
|
||||||
|
// Skip local actions
|
||||||
|
if (path.startsWith('.')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip internal actions
|
||||||
|
if (path.startsWith('signalapp/')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cacheKey = `${path}@${originalRef}`;
|
||||||
|
if (CACHE.has(cacheKey)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [org, repo] = path.split('/', 2);
|
||||||
|
|
||||||
|
const url =
|
||||||
|
`https://api.github.com/repos/${encodeURIComponent(org)}/` +
|
||||||
|
`${encodeURIComponent(repo)}/tags`;
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
const res = await fetch(url, {
|
||||||
|
headers: {
|
||||||
|
authorization: GITHUB_TOKEN ? `Bearer ${GITHUB_TOKEN}` : '',
|
||||||
|
'user-agent':
|
||||||
|
'Mozilla/5.0 (Macintosh; ' +
|
||||||
|
'Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error(`Failed to fetch ${url}, status: ${res.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
const tags = TagsSchema.parse(await res.json())
|
||||||
|
// Filter out invalid tags
|
||||||
|
.filter(tag => semver.valid(tag.name))
|
||||||
|
// Sort by latest release first
|
||||||
|
.sort((a, b) => semver.compare(b.name, a.name));
|
||||||
|
|
||||||
|
const targetRef = originalRef ?? ref;
|
||||||
|
let range = targetRef;
|
||||||
|
|
||||||
|
// Pad tag to be valid semver range
|
||||||
|
if (/^v\d+$/.test(range)) {
|
||||||
|
range = `^${range}.0.0`;
|
||||||
|
} else if (/^v\d+\.d+$/.test(range)) {
|
||||||
|
range = `^${range}.0`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pick first match
|
||||||
|
const match = tags.find(tag => semver.satisfies(tag.name, range));
|
||||||
|
if (!match) {
|
||||||
|
throw new Error(`Tag ${targetRef} not found for ${path}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
CACHE.set(cacheKey, `uses: ${path}@${match.commit.sha} # ${targetRef}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = source.replace(
|
||||||
|
REGEXP,
|
||||||
|
(match, _p1, _p2, _p3, _offset, _string, groups) => {
|
||||||
|
const { path, originalRef } = groups;
|
||||||
|
|
||||||
|
const cacheKey = `${path}@${originalRef}`;
|
||||||
|
return CACHE.get(cacheKey) || match;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await writeFile(fullPath, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main(): Promise<void> {
|
||||||
|
const actions = await readdir(WORKFLOWS_DIR);
|
||||||
|
|
||||||
|
for (const name of actions) {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await updateAction(join(WORKFLOWS_DIR, name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drop(main());
|
Reference in New Issue
Block a user