diff --git a/.github/workflows/fhevm-core-contracts-publish.yml b/.github/workflows/fhevm-core-contracts-publish.yml new file mode 100644 index 00000000..e5d5f905 --- /dev/null +++ b/.github/workflows/fhevm-core-contracts-publish.yml @@ -0,0 +1,24 @@ +name: Publish fhEVM Solidity core contracts release + +on: + release: + types: [released] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: "write" + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 20.x + - run: cd contracts + - run: .env.example .env + - run: npm ci --include=optional + - run: npm run compile + - uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1 + with: + token: ${{ secrets.NPM_TOKEN }} + provenance: true diff --git a/.github/workflows/fhevm-core-contracts-publishprerelease.yml b/.github/workflows/fhevm-core-contracts-publishprerelease.yml new file mode 100644 index 00000000..dd65708a --- /dev/null +++ b/.github/workflows/fhevm-core-contracts-publishprerelease.yml @@ -0,0 +1,25 @@ +name: Publish fhEVM Solidity core contracts prerelease + +on: + release: + types: [prereleased] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: "write" + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 20.x + - run: cd contracts + - run: cp .env.example .env + - run: npm ci --include=optional + - run: npm run compile + - uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1 + with: + tag: prerelease + token: ${{ secrets.NPM_TOKEN }} + provenance: true diff --git a/contracts/package-lock.json b/contracts/package-lock.json index 0432ef54..012e2b79 100644 --- a/contracts/package-lock.json +++ b/contracts/package-lock.json @@ -14,6 +14,7 @@ "@openzeppelin/hardhat-upgrades": "^3.3.0", "@trivago/prettier-plugin-sort-imports": "^4.0.0", "bigint-buffer": "^1.1.5", + "cross-env": "^7.0.3", "dotenv": "^16.4.5", "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0", @@ -4134,6 +4135,24 @@ "dev": true, "peer": true }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/contracts/package.json b/contracts/package.json index 7efbb1c0..71a7b061 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -4,6 +4,7 @@ "description": "fhEVM contracts", "main": "index.js", "scripts": { + "compile": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile", "lint": "npm run lint:sol && npm run lint:ts && npm run prettier:check", "lint:ts": "eslint --ignore-path ./.eslintignore --ext .js,.ts .", "prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yml}\"", @@ -24,6 +25,7 @@ "@openzeppelin/hardhat-upgrades": "^3.3.0", "@trivago/prettier-plugin-sort-imports": "^4.0.0", "bigint-buffer": "^1.1.5", + "cross-env": "^7.0.3", "dotenv": "^16.4.5", "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0",