Skip to content

Commit

Permalink
ci: use GHA for CFA releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 committed Aug 20, 2024
1 parent 678e7f8 commit 5a28c2c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 310 deletions.
83 changes: 0 additions & 83 deletions .circleci/config.yml

This file was deleted.

52 changes: 25 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,34 @@ on:
description: Electron version to use with "v" prefix (e.g. v30.0.0)
required: true

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
smoke_test:
test:
uses: ./.github/workflows/test.yml
with:
electron-version: ${{ github.event.inputs.version }}
release:
runs-on: ubuntu-latest
needs: test
environment: npm
permissions:
contents: write # to be able to publish a GitHub release
id-token: write # for CFA and npm provenance
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
node-version: "20.10.0"
persist-credentials: false
- name: "Use Node.js ${{ matrix.node-version }}"
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: "20.16.0"
- name: Update Version
run: node script/update-version.js ${{ github.event.inputs.version }}
- name: Install Dependencies
run: npm i
- name: Run Tests
run: npm test
create_new_version:
runs-on: ubuntu-latest
needs: smoke_test
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Tag here, the CircleCI workflow will trigger on the new tag and do the CFA publish
- name: Push New Tag
run: |
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
- name: Create Release
run: |
gh release create ${{ github.event.inputs.version }} -t ${{ github.event.inputs.version }}
- name: Confirm Version Updated
run: node -e "if (require('./package.json').version === '0.0.0-development') process.exit(1)"
- uses: continuousauth/action@4396fa3eb7c9790548b9e2b6e4f527df5b861add # v1.0.1
with:
project-id: ${{ secrets.CFA_PROJECT_ID }}
secret: ${{ secrets.CFA_SECRET }}
npm-token: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@continuous-auth/semantic-release-npm",
"@semantic-release/github"
],
"branches": ["main"]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Electron mksnapshot

[![CircleCI Status](https://circleci.com/gh/electron/mksnapshot/tree/main.svg?style=shield)](https://circleci.com/gh/electron/mksnapshot/tree/main)
[![Test](https://github.com/electron/mksnapshot/actions/workflows/test.yml/badge.svg)](https://github.com/electron/mksnapshot/actions/workflows/test.yml)
[![npm:](https://img.shields.io/npm/v/electron-mksnapshot.svg)](https://www.npmjs.com/package/electron-mksnapshot)
<br>
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
Expand Down
Loading

0 comments on commit 5a28c2c

Please sign in to comment.