* ci: switch to GHA

* chore: bump continuousauth/action version
This commit is contained in:
David Sanders 2024-11-13 14:23:02 -08:00 коммит произвёл GitHub
Родитель f7615c6366
Коммит 710324f0a0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 90 добавлений и 51 удалений

Просмотреть файл

@ -1,50 +0,0 @@
version: 2.1
orbs:
cfa: continuousauth/npm@2.1.1
node: electronjs/node@2.3.1
workflows:
test_and_release:
# Run the test jobs first, then the release only when all the test jobs are successful
jobs:
- node/test:
name: test-<< matrix.executor >>-<< matrix.node-version >>
override-ci-command: |
if [ << matrix.node-version >> = '14.16' ]; then
yarn install --frozen-lockfile --ignore-engines
else
yarn install --frozen-lockfile
fi
pre-steps:
- run: git config --global core.autocrlf input
- when:
condition:
and:
- equal: [ node/macos, << matrix.executor >> ]
- equal: [ '14.16', << matrix.node-version >> ]
steps:
- node/install-rosetta
post-steps:
- run: yarn build:docs
matrix:
alias: test
parameters:
executor:
- node/linux
- node/macos
- node/windows
node-version:
- '20.10'
- '18.18'
- '16.20'
# Stay below 14.17.0 or nvm tries to download arm64 artifacts which don't exist
- '14.16'
- cfa/release:
requires:
- test
filters:
branches:
only:
- main
context: cfa-release

35
.github/workflows/release.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,35 @@
name: Release
on:
push:
branches:
- main
jobs:
test:
uses: ./.github/workflows/test.yml
release:
name: Release
runs-on: ubuntu-latest
needs: test
environment: npm
permissions:
id-token: write # for CFA and npm provenance
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20.x
cache: 'yarn'
- name: Install
run: yarn install --frozen-lockfile
- uses: continuousauth/action@732eeb237ac0a0b330a7247f744ddc57898ff9c4 # v1.0.4
with:
project-id: ${{ secrets.CFA_PROJECT_ID }}
secret: ${{ secrets.CFA_SECRET }}
npm-token: ${{ secrets.NPM_TOKEN }}

51
.github/workflows/test.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,51 @@
name: Test
on:
pull_request:
branches:
- main
schedule:
- cron: '0 22 * * 3'
workflow_call:
permissions:
contents: read
jobs:
test:
name: Test
strategy:
matrix:
node-version:
- '20.10'
- '18.18'
- '16.20'
- '14.16'
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: "${{ matrix.os }}"
steps:
- run: git config --global core.autocrlf input
- name: Install Rosetta
if: ${{ matrix.os == 'macos-latest' && matrix.node-version == '14.16' }}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: "${{ matrix.node-version }}"
cache: 'yarn'
architecture: ${{ matrix.os == 'macos-latest' && matrix.node-version == '14.16' && 'x64' || env.RUNNER_ARCH }}
- name: Install (Node.js v16+)
if : ${{ matrix.node-version != '14.16' }}
run: yarn install --frozen-lockfile
- name: Install (Node.js < v16)
if : ${{ matrix.node-version == '14.16' }}
run: yarn install --frozen-lockfile --ignore-engines
- name: Test
run: yarn test
- name: Build docs
run: yarn build:docs

Просмотреть файл

@ -2,7 +2,7 @@
> Download Electron release artifacts
[![CircleCI](https://circleci.com/gh/electron/get.svg?style=shield)](https://circleci.com/gh/electron/get)
[![Test](https://github.com/electron/get/actions/workflows/test.yml/badge.svg)](https://github.com/electron/get/actions/workflows/test.yml)
[![NPM package](https://img.shields.io/npm/v/@electron/get)](https://npm.im/@electron/get)
## Usage

Просмотреть файл

@ -7,6 +7,9 @@
"repository": "https://github.com/electron/get",
"author": "Samuel Attard",
"license": "MIT",
"publishConfig": {
"provenance": true
},
"scripts": {
"build": "tsc && tsc -p tsconfig.esm.json",
"build:docs": "npx typedoc",