chore(integration-tests): fix trigger tests [NET-517] (#158) #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "release" | |
on: | |
push: | |
branches: | |
- "main" | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
outputs: | |
release-created: ${{ steps.release.outputs['release_created'] }} | |
tag-name: ${{ steps.release.outputs['tag_name'] }} | |
version: ${{ steps.release.outputs['version'] }} | |
pr: ${{ steps.release.outputs['pr'] }} | |
steps: | |
- name: Run release-please | |
id: release | |
uses: google-github-actions/release-please-action@v3 | |
with: | |
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }} | |
command: manifest | |
config-file: .github/release-please/config.json | |
manifest-file: .github/release-please/manifest.json | |
- 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 | |
bump-version: | |
if: needs.release-please.outputs.pr != null | |
runs-on: builder | |
needs: | |
- release-please | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} | |
- name: Setup Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install cargo-workspaces | |
uses: baptiste0928/[email protected] | |
with: | |
crate: cargo-workspaces | |
- name: Get version | |
id: version | |
run: | | |
version="$(jq -r '.[]' .github/release-please/manifest.json)" | |
echo "version=${version}" >> $GITHUB_OUTPUT | |
- name: Set versions | |
run: | | |
cargo ws version \ | |
--no-git-commit \ | |
--yes \ | |
--force '*' \ | |
custom ${{ steps.version.outputs.version }} | |
working-directory: src/spell/modules/spell | |
- name: Setup marine | |
uses: fluencelabs/setup-marine@v1 | |
- name: Build and package spell | |
working-directory: ./src/spell/modules/spell/spell | |
run: ./build.sh | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
registry-url: "https://registry.npmjs.org" | |
- name: Set aqua/spell version | |
run: npm version ${{ steps.version.outputs.version }} | |
working-directory: src/aqua/spell | |
- name: Run npm install | |
run: npm install | |
working-directory: src/aqua/spell | |
- name: Set aqua/installation-spell version | |
run: npm version ${{ steps.version.outputs.version }} | |
working-directory: src/aqua/installation-spell | |
- name: Set aqua/spell version in installation-spell dependencies | |
run: npm i --ignore-scripts -E @fluencelabs/spell@${{ steps.version.outputs.version }} | |
working-directory: src/aqua/installation-spell | |
- name: Commit version bump | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore: Bump spell version to ${{ steps.version.outputs.version }}" | |
branch: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} | |
commit_user_name: fluencebot | |
commit_user_email: [email protected] | |
commit_author: fluencebot <[email protected]> | |
spell: | |
if: needs.release-please.outputs.release-created | |
runs-on: builder | |
needs: release-please | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }} | |
- name: Import secrets | |
uses: hashicorp/[email protected] | |
with: | |
url: https://vault.fluence.dev | |
path: jwt/github | |
role: ci | |
method: jwt | |
jwtGithubAudience: "https://github.com/fluencelabs" | |
jwtTtl: 300 | |
exportToken: false | |
secrets: | | |
kv/crates.io/fluencebot token | CARGO_REGISTRY_TOKEN ; | |
kv/npmjs/fluencebot token | NODE_AUTH_TOKEN | |
- name: Setup Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install Marine | |
uses: baptiste0928/[email protected] | |
with: | |
crate: marine | |
- name: Build spell | |
working-directory: ./src/spell/modules/spell/spell | |
run: ./build.sh | |
- name: Install cargo-workspaces | |
uses: baptiste0928/[email protected] | |
with: | |
crate: cargo-workspaces | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
registry-url: "https://registry.npmjs.org" | |
cache-dependency-path: "src/aqua/spell" | |
cache: "npm" | |
- run: npm i | |
working-directory: "src/aqua/spell" | |
- name: Publish aqua/spell to NPM registry | |
run: npm publish --access public --tag unstable | |
working-directory: "src/aqua/spell" | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
registry-url: "https://registry.npmjs.org" | |
cache-dependency-path: "src/aqua/installation-spell" | |
cache: "npm" | |
- run: npm i | |
working-directory: "src/aqua/installation-spell" | |
- name: Publish aqua/installation-spell to NPM registry | |
run: npm publish --access public --tag unstable | |
working-directory: "src/aqua/installation-spell" | |
- name: Publish to crates.io | |
working-directory: ./src/spell/modules/spell | |
run: | | |
cargo ws publish \ | |
--no-git-commit \ | |
--allow-dirty \ | |
--from-git \ | |
--skip-published \ | |
--yes | |
slack: | |
if: always() | |
name: "Notify" | |
runs-on: ubuntu-latest | |
needs: | |
- release-please | |
- spell | |
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: | | |
echo "statuses:" "${{ steps.status.outputs.statuses }}" | |
echo "jobs:" "${{ steps.status.outputs.jobs }}" | |
echo "found any?:" "${{ steps.status.outputs.found }}" | |
- name: Import secrets | |
uses: hashicorp/[email protected] | |
with: | |
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 | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: steps.status.outputs.found == 'true' | |
with: | |
status: "failure" | |
notification_title: "*{workflow}* has {status_message}" | |
message_format: "${{ steps.status.outputs.jobs }} {status_message} in <{repo_url}|{repo}>" | |
footer: "<{run_url}>" |