chore: Add release-please and update PR CI (#35)

* Add release-please and update PR CI

* Add renovate config

* Update renovate config

* Fix
This commit is contained in:
Anatolios Laskaris 2023-02-15 15:46:11 +02:00 committed by GitHub
parent c1d0209c81
commit 4cd81dbe43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 14685 additions and 115 deletions

11
.github/release-please/config.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"bootstrap-sha": "c1d0209c81976c2b232b13f5526e81dba0875f05",
"release-type": "node",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"packages": {
".": {
"component": "aqua-lib"
}
}
}

3
.github/release-please/manifest.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
".": "0.7.0"
}

29
.github/renovate.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"enabledManagers": ["npm", "github-actions"],
"schedule": "every weekend",
"packageRules": [
{
"matchUpdateTypes": ["major"],
"prConcurrentLimit": 1
},
{
"matchManagers": ["github-actions"],
"prPriority": 1
},
{
"matchManagers": ["npm"],
"matchPackagePatterns": [
"@fluencelabs/.*"
],
"schedule": "at any time"
},
{
"matchDepTypes": ["devDependencies"],
"prPriority": -1
}
]
}

View File

@ -1,6 +0,0 @@
{
"template": "## Changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}\n\n${{UNCATEGORIZED}}",
"pr_template": "- #${{NUMBER}} ${{TITLE}}",
"empty_template": "## No changes since ${{FROM_TAG}}",
"sort": "DESC"
}

View File

@ -1,34 +0,0 @@
name: "check-compilation"
on:
push:
jobs:
check-compiles:
name: "Check Aqua compiles"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-v1-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v1-node
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install aqua compiler
run: npm install -g @fluencelabs/aqua
- name: Check compilation
run: aqua -i . --dry

31
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: "ci"
on:
pull_request:
push:
branches:
- "main"
env:
FORCE_COLOR: true
jobs:
check-compiles:
name: "Check Aqua compiles"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
cache: "npm"
- run: npm i
- name: Check compilation
run: npm run compile-dry

35
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: lint
on:
pull_request:
types:
- opened
- edited
- synchronize
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
pr:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
reviewdog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint actions
uses: reviewdog/action-actionlint@v1
env:
SHELLCHECK_OPTS: "-e SC2086"
with:
reporter: github-pr-check
fail_on_error: true

View File

@ -1,76 +1,124 @@
name: "publish-release"
name: "release-please"
on:
push:
tags:
- "v*"
branches:
- "main"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
env:
FORCE_COLOR: true
jobs:
npm-publish:
name: "Publish"
release-please:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
releases-created: ${{ steps.release.outputs.releases_created }}
fluence-cli-release-created: ${{ steps.release.outputs['release_created'] }}
fluence-cli-tag-name: ${{ steps.release.outputs['tag_name'] }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/cache@v2
- name: Run release-please
id: release
uses: google-github-actions/release-please-action@v3
with:
path: ~/.npm
key: ${{ runner.os }}-v1-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v1-node
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
command: manifest
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json
- name: Setup Node.js
uses: actions/setup-node@v1
- name: Show output from release-please
if: steps.release.outputs.releases_created
env:
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }}
run: echo "${RELEASE_PLEASE_OUTPUT}" | jq
aqua-lib:
if: needs.release-please.outputs.fluence-cli-release-created
runs-on: ubuntu-latest
needs:
- release-please
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Import secrets
uses: hashicorp/vault-action@v2.4.3
with:
node-version: 16
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
exportToken: false
secrets: |
kv/npmjs/fluencebot token | NODE_AUTH_TOKEN
- name: Install aqua compiler
run: npm install -g @fluencelabs/aqua
- name: Check compilation
run: aqua -i . --dry
### Publish to NPM registry
- uses: actions/setup-node@v1
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Publish to NPM
- run: npm i
- name: Publish to npm registry
run: npm publish --access public --tag unstable
slack:
if: always()
name: "Notify"
runs-on: ubuntu-latest
needs:
- release-please
- aqua-lib
permissions:
contents: read
id-token: write
steps:
- uses: lwhiteley/dependent-jobs-result-check@v1
id: status
with:
statuses: failure
dependencies: ${{ toJSON(needs) }}
- name: Log output
run: |
npm --no-git-tag-version version ${{ env.RELEASE_VERSION }}
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN2 }}
echo "statuses:" "${{ steps.status.outputs.statuses }}"
echo "jobs:" "${{ steps.status.outputs.jobs }}"
echo "found any?:" "${{ steps.status.outputs.found }}"
### Create a release
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
- name: Import secrets
uses: hashicorp/vault-action@v2.4.3
with:
configuration: ".github/workflows/changelog_config.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
exportToken: false
secrets: |
kv/slack/release-please webhook | SLACK_WEBHOOK_URL
- name: Release
uses: softprops/action-gh-release@v1
- uses: ravsamhq/notify-slack-action@v2
if: steps.status.outputs.found == 'true'
with:
name: aqua-lib ${{ env.RELEASE_VERSION }}
tag_name: ${{ env.RELEASE_VERSION }}
body: |
${{steps.github_release.outputs.changelog}}
## NPM package
[${{ env.RELEASE_VERSION }} @ NPM registry](https://www.npmjs.com/package/@fluencelabs/aqua-lib/v/${{ env.RELEASE_VERSION }})
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
status: "failure"
notification_title: "*{workflow}* has {status_message}"
message_format: "${{ steps.status.outputs.jobs }} {status_message} in <{repo_url}|{repo}>"
footer: "<{run_url}>"

View File

@ -1,17 +0,0 @@
name: "tag"
on:
workflow_dispatch:
jobs:
tag:
name: "Tag"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.5
with:
github_token: ${{ secrets.PERSONAL_TOKEN }}

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.tgz
node_modules/

14467
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,10 +16,16 @@
"aqua",
"fluence"
],
"scripts": {
"compile-dry": "aqua -i . --dry"
},
"author": "Fluence Labs",
"license": "MIT",
"bugs": {
"url": "https://github.com/fluencelabs/aqua-lib/issues"
},
"homepage": "https://github.com/fluencelabs/aqua-lib#readme"
"homepage": "https://github.com/fluencelabs/aqua-lib#readme",
"devDependencies": {
"@fluencelabs/aqua": "0.9.4"
}
}