fix: fixed #11
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 | |
env: | |
FORCE_COLOR: true | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.release.outputs['version'] }} | |
pr: ${{ steps.release.outputs['pr'] }} | |
tag-name: ${{ steps.release.outputs['tag_name'] }} | |
release_created: ${{ steps.release.outputs['release_created'] }} | |
steps: | |
- name: Release with release-please | |
id: release | |
uses: google-github-actions/release-please-action@v4 | |
with: | |
token: ${{ secrets.RELEASE_TOKEN }} | |
config-file: .github/release-please/config.json | |
manifest-file: .github/release-please/manifest.json | |
- name: Show output from release-please | |
env: | |
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }} | |
run: echo "${RELEASE_PLEASE_OUTPUT}" | jq | |
validate: | |
if: ${{ needs.release-please.outputs.pr != null }} | |
runs-on: ubuntu-latest | |
needs: | |
- release-please | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup fcli | |
uses: fluencelabs/setup-fluence@v1 | |
with: | |
# TODO: fluence module pack works only on main now, need to change later | |
version: main | |
- name: Setup IPFS CLI | |
uses: nahsi/setup-ipfs@v1 | |
- name: Validate | |
run: ./validate.sh | |
bump-version: | |
if: ${{ needs.release-please.outputs.pr != null }} | |
runs-on: ubuntu-latest | |
needs: | |
- release-please | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} | |
token: ${{ secrets.RELEASE_TOKEN }} | |
- name: Setup Rust toolchain | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Install cargo-edit | |
uses: baptiste0928/[email protected] | |
with: | |
crate: cargo-edit | |
- name: Get version | |
id: version | |
run: | | |
version="$(jq -r '.[]' .github/release-please/manifest.json)" | |
echo "version=${version}" >> $GITHUB_OUTPUT | |
# Update ALL packages version if some is changed | |
- name: Set version | |
run: cargo set-version ${{ steps.version.outputs.version }} | |
- name: Commit version bump | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: Bump version to ${{ steps.version.outputs.version }}" | |
branch: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} | |
upload-archive: | |
if: ${{ needs.release-please.outputs.release_created }} | |
runs-on: ubuntu-latest | |
needs: | |
- release-please | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup fcli | |
uses: fluencelabs/setup-fluence@v1 | |
with: | |
# TODO: fluence module pack works only on main now, need to change later | |
version: main | |
- name: Build archive | |
run: fluence module pack ./effector/ --binding-crate=./imports/ --no-input -d . | |
- name: Extract CID | |
id: extract_cid | |
run: | | |
cid="$(tar -axf ls_effector.tar.gz module.yaml -O | grep cid | cut -d' ' -f2)" | |
echo "cid=${cid}" > $GITHUB_OUTPUT | |
- name: Upload archive | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.release-please.outputs.tag-name }} | |
append_body: true | |
body: | | |
# | |
Effector CIDv1: ${{ steps.extract_cid.outputs.cid }} | |
files: | | |
./ls_effector.tar.gz |