Skip to content

Commit

Permalink
ci: add runnable workflow for core contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xawaz committed Dec 23, 2024
1 parent 9e31ae6 commit 05a044b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 40 deletions.
58 changes: 47 additions & 11 deletions .github/workflows/fhevm-core-contracts-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Publish fhEVM Solidity core contracts release
name: Publish fhEVM Solidity core contracts

on:
release:
types: [released]
workflow_dispatch:
inputs:
release:
description: "Set to true for release tagging"
required: false
default: false

jobs:
publish:
Expand All @@ -11,18 +15,50 @@ jobs:
run:
working-directory: ./contracts
permissions:
id-token: "write"
contents: read
id-token: write
packages: write
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- name: Check out repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- run: cp .env.example.deployment .env
- run: npm ci --include=optional
- run: npm run compile
- run: npm run compile:gateway
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1

- name: Prepare environment file
run: cp .env.example.deployment .env

- name: Install dependencies
run: npm ci --include=optional

- name: Compile contracts
run: npm run compile

- name: Compile gateway
run: npm run compile:gateway

- name: Publish to npm
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
with:
package: ./contracts/package.json
token: ${{ secrets.NPM_TOKEN }}
provenance: true

- name: Publish prerelease to npm
if: ${{ inputs.release != 'true' }}
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
with:
package: ./contracts/package.json
tag: prerelease
token: ${{ secrets.NPM_TOKEN }}
provenance: true

- name: Publish release to npm
if: ${{ inputs.release == 'true' }}
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
with:
package: ./contracts/package.json
token: ${{ secrets.NPM_TOKEN }}
provenance: true
29 changes: 0 additions & 29 deletions .github/workflows/fhevm-core-contracts-publishprerelease.yml

This file was deleted.

0 comments on commit 05a044b

Please sign in to comment.