Skip to content

(fix)Changing the headings of CHANGELOG.md so they all display the ve… #16

(fix)Changing the headings of CHANGELOG.md so they all display the ve…

(fix)Changing the headings of CHANGELOG.md so they all display the ve… #16

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust 1.82.0
uses: dtolnay/rust-toolchain@1.82.0
with:
components: rustfmt, clippy
- name: Cargo Format Check
run: cargo fmt --all -- --check
- name: Clippy Check
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Doc Check
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps --document-private-items
- name: Run Tests
run: cargo test --all-features
- name: Build Documentation
run: cargo doc --no-deps --document-private-items
verify:
name: Verify Release
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Check build
run: cargo check --all-features
publish-proc:
name: Publish lambda-appsync-proc
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish proc macros
run: |
cd lambda-appsync-proc
cargo publish
- name: Wait for crates.io
run: sleep 30
publish-main:
name: Publish lambda-appsync
needs: publish-proc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Update dependency
run: |
cd lambda-appsync
# Update proc macro dependency to use published version
sed -i 's/path = "..\/lambda-appsync-proc"/version = "'${GITHUB_REF_NAME#v}'"/g' Cargo.toml
- name: Publish main crate
run: |
cd lambda-appsync
cargo publish --allow-dirty
release:
name: Create GitHub Release
needs: publish-main
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Extract changelog section
run: |
VERSION="${GITHUB_REF_NAME#v}"
awk -v ver="$VERSION" '
/^## \[/ {
if (found) exit
split($0, a, /[\[\]]/)
if (a[2] == ver) { found=1; next }
}
found && /^\[[0-9]+\.[0-9]+\.[0-9]+\]: / { next }
found { print }
' CHANGELOG.md | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba;}' > /tmp/release-body.md
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes-file /tmp/release-body.md