Skip to content

Commit

Permalink
Joroshiba/release take 2 (#421)
Browse files Browse the repository at this point in the history
## Summary
Revert of revert + fix for release changes

## Background
Previously pushed changes to update release flows, it didn't work, and
the nature of tests was such that rollback and redeploy with fix is best
option.

## Changes
- Everything from #413 + fix around base ref not
existing
  • Loading branch information
joroshiba committed Sep 21, 2023
1 parent c10a3e2 commit c6f783a
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 9 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
53 changes: 53 additions & 0 deletions .github/workflows/reusable-cargo-version.yml
Original file line number Diff line number Diff line change
@@ -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

3 changes: 3 additions & 0 deletions .github/workflows/reusable-run-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/astria-composer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astria-composer"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
rust-version = "1.70.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astria-conductor"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
rust-version = "1.70.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/astria-sequencer-relayer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-sequencer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astria-sequencer"
version = "0.2.0"
version = "0.4.0"
edition = "2021"
rust-version = "1.70.0"

Expand Down

0 comments on commit c6f783a

Please sign in to comment.