mirror of
https://github.com/fluencelabs/aqua-lib
synced 2024-12-04 15:20:23 +00:00
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:
parent
c1d0209c81
commit
4cd81dbe43
11
.github/release-please/config.json
vendored
Normal file
11
.github/release-please/config.json
vendored
Normal 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
3
.github/release-please/manifest.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
".": "0.7.0"
|
||||||
|
}
|
29
.github/renovate.json
vendored
Normal file
29
.github/renovate.json
vendored
Normal 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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
6
.github/workflows/changelog_config.json
vendored
6
.github/workflows/changelog_config.json
vendored
@ -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"
|
|
||||||
}
|
|
34
.github/workflows/check.yml
vendored
34
.github/workflows/check.yml
vendored
@ -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
31
.github/workflows/ci.yml
vendored
Normal 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
35
.github/workflows/lint.yml
vendored
Normal 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
|
158
.github/workflows/release.yml
vendored
158
.github/workflows/release.yml
vendored
@ -1,76 +1,124 @@
|
|||||||
name: "publish-release"
|
name: "release-please"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- "v*"
|
- "main"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
npm-publish:
|
release-please:
|
||||||
name: "Publish"
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
|
||||||
run:
|
outputs:
|
||||||
shell: bash
|
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:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Run release-please
|
||||||
uses: actions/checkout@v2
|
id: release
|
||||||
|
uses: google-github-actions/release-please-action@v3
|
||||||
- name: Set RELEASE_VERSION
|
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
|
||||||
key: ${{ runner.os }}-v1-node-${{ hashFiles('**/package-lock.json') }}
|
command: manifest
|
||||||
restore-keys: |
|
config-file: .github/release-please/config.json
|
||||||
${{ runner.os }}-v1-node
|
manifest-file: .github/release-please/manifest.json
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Show output from release-please
|
||||||
uses: actions/setup-node@v1
|
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:
|
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
|
- name: Setup node
|
||||||
run: npm install -g @fluencelabs/aqua
|
uses: actions/setup-node@v3
|
||||||
|
|
||||||
- name: Check compilation
|
|
||||||
run: aqua -i . --dry
|
|
||||||
|
|
||||||
### Publish to NPM registry
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "16"
|
||||||
registry-url: "https://registry.npmjs.org"
|
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: |
|
run: |
|
||||||
npm --no-git-tag-version version ${{ env.RELEASE_VERSION }}
|
echo "statuses:" "${{ steps.status.outputs.statuses }}"
|
||||||
npm publish --access public
|
echo "jobs:" "${{ steps.status.outputs.jobs }}"
|
||||||
env:
|
echo "found any?:" "${{ steps.status.outputs.found }}"
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN2 }}
|
|
||||||
|
|
||||||
### Create a release
|
- name: Import secrets
|
||||||
- name: Build Changelog
|
uses: hashicorp/vault-action@v2.4.3
|
||||||
id: github_release
|
|
||||||
uses: mikepenz/release-changelog-builder-action@v1
|
|
||||||
with:
|
with:
|
||||||
configuration: ".github/workflows/changelog_config.json"
|
url: https://vault.fluence.dev
|
||||||
env:
|
path: jwt/github
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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: ravsamhq/notify-slack-action@v2
|
||||||
uses: softprops/action-gh-release@v1
|
if: steps.status.outputs.found == 'true'
|
||||||
with:
|
with:
|
||||||
name: aqua-lib ${{ env.RELEASE_VERSION }}
|
status: "failure"
|
||||||
tag_name: ${{ env.RELEASE_VERSION }}
|
notification_title: "*{workflow}* has {status_message}"
|
||||||
body: |
|
message_format: "${{ steps.status.outputs.jobs }} {status_message} in <{repo_url}|{repo}>"
|
||||||
${{steps.github_release.outputs.changelog}}
|
footer: "<{run_url}>"
|
||||||
|
|
||||||
## 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 }}
|
|
||||||
|
17
.github/workflows/tag.yml
vendored
17
.github/workflows/tag.yml
vendored
@ -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
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
*.tgz
|
*.tgz
|
||||||
|
node_modules/
|
||||||
|
14467
package-lock.json
generated
14467
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -16,10 +16,16 @@
|
|||||||
"aqua",
|
"aqua",
|
||||||
"fluence"
|
"fluence"
|
||||||
],
|
],
|
||||||
|
"scripts": {
|
||||||
|
"compile-dry": "aqua -i . --dry"
|
||||||
|
},
|
||||||
"author": "Fluence Labs",
|
"author": "Fluence Labs",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/fluencelabs/aqua-lib/issues"
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user