diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 755e6958f2..0b9f901403 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,40 @@ jobs: input: "crates/astria-proto/proto" buf_token: ${{ secrets.BUF_TOKEN }} + conductor: + needs: run_checker + if: needs.run_checker.outputs.run_release_services == 'true' + uses: ./.github/workflows/reusable-cargo-version.yml + with: + package-name: 'conductor' + display-name: 'Conductor' + + composer: + needs: run_checker + if: needs.run_checker.outputs.run_release_services == 'true' + uses: ./.github/workflows/reusable-cargo-version.yml + with: + package-name: 'composer' + display-name: 'Composer' + + sequencer: + needs: run_checker + if: needs.run_checker.outputs.run_release_services == 'true' + uses: ./.github/workflows/reusable-cargo-version.yml + with: + package-name: 'sequencer' + display-name: 'Sequencer' + + sequencer-relayer: + needs: run_checker + if: needs.run_checker.outputs.run_release_services == 'true' + uses: ./.github/workflows/reusable-cargo-version.yml + with: + package-name: 'sequencer-relayer' + display-name: 'Sequencer Relayer' + + release: - needs: [proto] + needs: [proto, conductor, composer, sequencer, sequencer-relayer] if: ${{ always() && !cancelled() }} uses: ./.github/workflows/reusable-success.yml diff --git a/.github/workflows/reusable-cargo-version.yml b/.github/workflows/reusable-cargo-version.yml new file mode 100644 index 0000000000..42a5a2013f --- /dev/null +++ b/.github/workflows/reusable-cargo-version.yml @@ -0,0 +1,53 @@ +name: Reusable Cargo Version Check + +on: + workflow_call: + inputs: + package-name: + required: true + type: string + display-name: + required: true + type: string + +jobs: + rust-version-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: git fetch --all --tags + - name: Check Release Version + id: release_version + uses: thebongy/version-check@v1 + with: + file: ${{ format('crates/astria-{0}/Cargo.toml', inputs.package-name) }} + tagFormat: ${{ format('v${{version}}--{0}', inputs.package-name) }} + # Notice appears when the version has changed on a PR to main + - name: Release Notice + if: | + steps.release_version.outputs.versionChanged && + github.event_name == 'pull_request' && + github.base_ref == 'main' + run: | + FILE="${{ format('crates/astria-{0}/Cargo.toml', inputs.package-name) }}" + TITLE="New ${{ inputs.display-name}} Release" + MESSAGE=("This PR updates the version of ${{ inputs.package-name }}." + "After merging a new release ${{steps.release_version.outputs.rawVersion}}" + "will be created with tag ${{ steps.release_version.outputs.releaseVersion }}." + ) + echo "::warning file=$FILE,title=$TITLE::${MESSAGE[*]}" + # Actually release when version has changed on a push to main + - name: Release + if: | + steps.release_version.outputs.versionChanged == 'true' && + github.event_name == 'push' && + github.ref == 'refs/heads/main' + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.release_version.outputs.releaseVersion }} + release_name: ${{ inputs.display-name }} ${{ steps.release_version.outputs.rawVersion }} + draft: true + prerelease: true + diff --git a/.github/workflows/reusable-run-checker.yml b/.github/workflows/reusable-run-checker.yml index f15d0b8060..ed6c32a818 100644 --- a/.github/workflows/reusable-run-checker.yml +++ b/.github/workflows/reusable-run-checker.yml @@ -24,6 +24,9 @@ on: run_release_proto: description: If release for protos needs to be run, will be 'true' value: ${{ jobs.changes.outputs.release_workflow == 'true' || jobs.changes.outputs.proto == 'true' }} + run_release_services: + description: If release for services needs to be run, will be 'true' + value: ${{ jobs.changes.outputs.release_workflow == 'true' || jobs.changes.outputs.crates == 'true' }} jobs: changes: diff --git a/Cargo.lock b/Cargo.lock index d34ed5b5a0..0272f1857b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "astria-composer" -version = "0.1.0" +version = "0.2.0" dependencies = [ "astria-proto", "astria-sequencer-client", @@ -226,7 +226,7 @@ dependencies = [ [[package]] name = "astria-conductor" -version = "0.4.0" +version = "0.5.0" dependencies = [ "astria-proto", "astria-sequencer-client", @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "astria-sequencer" -version = "0.2.0" +version = "0.4.0" dependencies = [ "anyhow", "astria-proto", @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "astria-sequencer-relayer" -version = "0.4.0" +version = "0.5.0" dependencies = [ "astria-celestia-jsonrpc-client", "astria-proto", diff --git a/crates/astria-composer/Cargo.toml b/crates/astria-composer/Cargo.toml index ce06474656..53ef4b1579 100644 --- a/crates/astria-composer/Cargo.toml +++ b/crates/astria-composer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astria-composer" -version = "0.1.0" +version = "0.2.0" edition = "2021" rust-version = "1.70.0" diff --git a/crates/astria-conductor/Cargo.toml b/crates/astria-conductor/Cargo.toml index d42dca690a..4ed435dabf 100644 --- a/crates/astria-conductor/Cargo.toml +++ b/crates/astria-conductor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astria-conductor" -version = "0.4.0" +version = "0.5.0" edition = "2021" rust-version = "1.70.0" diff --git a/crates/astria-sequencer-relayer/Cargo.toml b/crates/astria-sequencer-relayer/Cargo.toml index b204d85ddb..e45840916e 100644 --- a/crates/astria-sequencer-relayer/Cargo.toml +++ b/crates/astria-sequencer-relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astria-sequencer-relayer" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.70" diff --git a/crates/astria-sequencer/Cargo.toml b/crates/astria-sequencer/Cargo.toml index ca2e733a5e..fae2acf411 100644 --- a/crates/astria-sequencer/Cargo.toml +++ b/crates/astria-sequencer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astria-sequencer" -version = "0.2.0" +version = "0.4.0" edition = "2021" rust-version = "1.70.0"