Skip to content

Commit

Permalink
Merge pull request #100 from sygmaprotocol/mpetrun5/update-release-flow
Browse files Browse the repository at this point in the history
chore: update release flow
  • Loading branch information
mpetrun5 authored Jan 16, 2023
2 parents 5866c8c + 7a3039a commit ecc7d9d
Show file tree
Hide file tree
Showing 78 changed files with 13,252 additions and 26,415 deletions.
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true
},
extends: [
"eslint:recommended"
],
overrides: [
],
parserOptions: {
ecmaVersion: "latest"
},
rules: {
"no-undef": "off",
"func-call-spacing": "off",
"max-len": ["error", {
"code": 120
}],
"new-parens": "error",
"no-caller": "error",
"no-bitwise": "off",
"no-console": "off",
"no-var": "error",
"object-curly-spacing": ["error", "never"],
"prefer-const": "error",
"quotes": ["error", "double"],
"semi": "off"
}
}
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on: [pull_request]
name: Linter check

jobs:
lint-solidity:
name: Lint Solidity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'

- run: yarn install --frozen-lockfile --non-interactive

- name: Run linter
run: yarn run lint:solidity

lint-js:
name: Lint JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'

- run: yarn install --frozen-lockfile --non-interactive
- name: Run linter
run: yarn run lint:js
18 changes: 18 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [pull_request]
name: "Semantic PR"

jobs:
validation:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: false
22 changes: 2 additions & 20 deletions .github/workflows/publish-contracts.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
name: Release Contracts

on:
push:
branches:
- 'master'
release:
types: [published]

jobs:
tag:
name: Check and Tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create tag
id: tag
uses: butlerlogic/[email protected]
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
strategy: package # Optional, since "package" is the default strategy
tag_prefix: "v"
outputs:
tag: ${{ steps.tag.outputs.tagname }}

release-contracts:
name: Release Contracts
runs-on: ubuntu-latest
Expand All @@ -45,7 +28,6 @@ jobs:
- name: Compile contracts
run: yarn run compile


- name: Deploy local 1
run: yarn run deploy:local:1

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Create Sygma solidity release

on:
push:
branches:
- master
jobs:
release-please:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:

- uses: actions/checkout@v2
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.RELEASE_TOKEN }}
release-type: node
package-name: '@buildwithsygma/sygma-contracts'
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
steps:
- name: Checkout code
uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js ${{ matrix.node-version }}
Expand All @@ -36,16 +36,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: NPM install
run: npm install
- name: Yarn install
run: yarn install --frozen-lockfile
- name: Run coverage
run: ./node_modules/.bin/truffle run coverage -solcoverjs ./scripts/.solcover.js --network test
- name: Coverall
Expand Down
6 changes: 6 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "solhint:default",
"rules": {
"max-line-length": ["off", 120]
}
}
2 changes: 1 addition & 1 deletion migrations/1_initial_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
*/
const Migrations = artifacts.require("Migrations");

module.exports = function(deployer) {
module.exports = function (deployer) {
deployer.deploy(Migrations);
};
Loading

0 comments on commit ecc7d9d

Please sign in to comment.