Skip to content

Commit

Permalink
chore(ci): Change release type to simple [fixes FLU-238] (#33)
Browse files Browse the repository at this point in the history
I think it works better that three separate packages.
Plus there is no need to wait/fix this
googleapis/release-please#1724
  • Loading branch information
nahsi committed Jan 24, 2023
1 parent 05826df commit 85be442
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 149 deletions.
27 changes: 3 additions & 24 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
{
"bootstrap-sha": "5900f69dbbb01a33807636c7dc80d892b2efe56c",
"release-type": "rust",
"bootstrap-sha": "05826df8025e56a2217432959685fd3c8d7ca750",
"release-type": "simple",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"plugins": [
{
"type": "cargo-workspace",
"merge": false
},
{
"type": "linked-versions",
"groupName": "spell, spell-distro and spell-dtos",
"components": [
"spell", "spell-distro", "spell-dtos"
]
}
],
"packages": {
"src/spell/modules/spell/spell": {
".": {
"package-name": "spell",
"component": "spell"
},
"src/spell/modules/spell/spell-distro": {
"package-name": "spell-distro",
"component": "spell-distro"
},
"src/spell/modules/spell/spell-dtos": {
"package-name": "spell-dtos",
"component": "spell-dtos"
}
}
}
4 changes: 3 additions & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"src/spell/modules/spell/spell-dtos":"0.1.4","src/spell/modules/spell/spell":"0.2.0","src/spell/modules/spell/spell-distro":"0.2.0"}
{
".": "0.2.0"
}
84 changes: 56 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@ jobs:
runs-on: ubuntu-latest

outputs:
releases-created: ${{ steps.release.outputs.releases_created }}

spell-release-created: ${{ steps.release.outputs['spell--release_created'] }}
spell-tag-name: ${{ steps.release.outputs['spell--tag_name'] }}

spell-distro-release-created: ${{ steps.release.outputs['spell-distro--release_created'] }}
spell-distro-tag-name: ${{ steps.release.outputs['spell-distro--tag_name'] }}

spell-dtos-release-created: ${{ steps.release.outputs['spell-dtos--release_created'] }}
spell-dtos-tag-name: ${{ steps.release.outputs['spell-dtos--tag_name'] }}
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
Expand All @@ -39,11 +34,57 @@ jobs:
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }}
run: echo "${RELEASE_PLEASE_OUTPUT}" | jq

spell:
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/cargo-install@v1.3.0
with:
crate: cargo-worspaces

- 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: 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: devops@fluence.one
commit_author: fluencebot <devops@fluence.one>

spell:
if: needs.release-please.outputs.release-created
runs-on: builder
needs: release-please
if: ${{ needs.release-please.outputs.releases-created }}

permissions:
contents: write
Expand Down Expand Up @@ -84,6 +125,7 @@ jobs:
crate: cargo-workspaces

- name: Publish to crates.io
working-directory: ./src/spell/modules/spell
run: |
cargo ws publish \
--no-git-commit \
Expand All @@ -107,22 +149,8 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: src/spell/modules/spell/spell/artifacts/spell.tar.gz
tag_name: ${{ needs.release-please.outputs.spell-tag-name }}

# - name: Update version in node-distro repo
# uses: benc-uk/workflow-dispatch@v1
# with:
# workflow: update_service
# repo: fluencelabs/node-distro
# ref: 'main'
# token: ${{ secrets.PERSONAL_TOKEN }}
# inputs: '{
# "name": "spell",
# "version": "${{ needs.release-please.spell-tag-name }}",
# "url": "${{ steps.package-url.outputs.result }}",
# "sha256": "${{ steps.sha.outputs.sha256 }}"
# }'
#
tag_name: ${{ needs.release-please.outputs.tag-name }}

slack:
if: always()
name: "Notify"
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

### ⚠ BREAKING CHANGES

* **errors:** SpellValueT::get_error -> SpellValueT::take_error to get rid of `.clone()`

### Features

* **kv:** add exists method [NET-301] ([#20](https://github.com/fluencelabs/spell/issues/20)) ([360d5ea](https://github.com/fluencelabs/spell/commit/360d5eade111fae5ce4a8835f33dada464c9fc32))
* add serializable to TriggerConfig ([#8](https://github.com/fluencelabs/spell/issues/8)) ([e1b0e28](https://github.com/fluencelabs/spell/commit/e1b0e2855b23d0457c92245b1a5f7c24b5cb6ac2))
* **errors:** SpellValueT::get_error -&gt; SpellValueT::take_error ([#21](https://github.com/fluencelabs/spell/issues/21)) ([531d856](https://github.com/fluencelabs/spell/commit/531d856a91ac60bd3e72841dc86feafbd6f7cb46))
* set `absent` flag when key is not in KV ([#19](https://github.com/fluencelabs/spell/issues/19)) ([a62e03e](https://github.com/fluencelabs/spell/commit/a62e03e6c681add41b67d6461fd729cd324955f4))

### Bug Fixes

* add doc-comment for spell-distro::modules ([#9](https://github.com/fluencelabs/spell/issues/9)) ([501432f](https://github.com/fluencelabs/spell/commit/501432fd7774a2a77211b77f475fc05d9ae2f2b8))
6 changes: 0 additions & 6 deletions Cargo.toml

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions src/spell/modules/spell/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]
members = [
"spell",
"spell-dtos",
"spell-distro"
]
25 changes: 0 additions & 25 deletions src/spell/modules/spell/spell-distro/CHANGELOG.md

This file was deleted.

29 changes: 0 additions & 29 deletions src/spell/modules/spell/spell-dtos/CHANGELOG.md

This file was deleted.

34 changes: 0 additions & 34 deletions src/spell/modules/spell/spell/CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/spell/modules/spell/spell/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ marine build --release

# copy .wasm to artifacts
mkdir -p artifacts
cp ../../../../../target/wasm32-wasi/release/spell.wasm artifacts/
cp ../target/wasm32-wasi/release/spell.wasm artifacts/

if [[ ! -f "artifacts/sqlite3.wasm" ]]; then
# download SQLite 3
Expand Down
2 changes: 1 addition & 1 deletion src/spell/modules/spell/spell/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm -f /tmp/spell.sqlite

# build spell.wasm
marine build --release
cp ../../../../../target/wasm32-wasi/release/spell.wasm tests_artifacts/
cp ../target/wasm32-wasi/release/spell.wasm tests_artifacts/

if [[ ! -f "tests_artifacts/sqlite3.wasm" ]]; then
# download SQLite 3
Expand Down

0 comments on commit 85be442

Please sign in to comment.