ethers-rs/.github/workflows/releases.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

100 lines
3.4 KiB
YAML
Raw Normal View History

ci/test: improve CI jobs and tests (#2189) * ci: move to scripts directory * nits * ci: improve main CI jobs * fix: install script * fix * fix: use curl for windows installation * fix: wasm typo * tests: move to single binary * chore: clippy * chore: clippy * chore: clippy * fix: test command * fix: quote tests * update script * fix: action exclude * fix: dev deps * fix: only run wasm in own job * ci: add aarch64 targets * test: rm useless test * ci: update security audit * ci: add deny CI * chore: rm unused audit.toml * chore: update geth.rs * ci: remove unusable targets * fix: install script path * fix: wasm * improve script * fix: failing ci * fix: contract tests * ci: improve install script * update middleware tests * move integration etherscan tests to tests/ dir * fix: eip2930 access_list field name * add pendingtransaction must_use * add random anvil comment * ci: add miri job * ci: simplify * fixci * Revert "add pendingtransaction must_use" This reverts commit 770b21b4a3c6ef8900a6aa1cd46aa9638317a60d. * fix: macos script * fix: use curl in script * unused ci * update script * fix wasm * rm_miri * fix: signer test * fix: wasm ci * fix: ipc test * fix: live celo tests * fix: abi online source test * fix: windows paths in test * chore: update serial_test * ci: run live tests separately * fix: provider tests * fix: unused var * fix: feature * fix merge * fix: etherscan key tests * ci: rm duplicate audit * fix: split etherscan test ci * fix: etherscan test * fix: generate multiple unused ports * fix: source test * fix: udeps * rm unused
2023-03-01 00:26:27 +00:00
name: release
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
inputs:
release_type:
type: choice
description: Release type
options:
- major
- minor
- patch
- rc
- beta
- alpha
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
RELEASE_TYPE: ${{ github.event.inputs.release_type }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Install cargo-release
uses: actions-rs/install@v0.1
with:
crate: cargo-release
version: latest
- name: Cargo login
run: |
cargo login $CARGO_TOKEN
- name: Dry-run cargo release
run: |
cargo release --workspace ${RELEASE_TYPE:-alpha} --exclude ethers-wasm
- name: Publish release
run: |
cargo release --workspace ${RELEASE_TYPE:-alpha} --exclude ethers-wasm --execute --no-confirm
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 14
- run: |
npm i semver
- name: Install git-cliff
uses: actions-rs/install@v0.1
with:
crate: git-cliff
version: latest
- name: Publish changelog
id: changelog
run: |
current_version=$(git tag --contains HEAD -l "v*" | head -1)
ci/test: improve CI jobs and tests (#2189) * ci: move to scripts directory * nits * ci: improve main CI jobs * fix: install script * fix * fix: use curl for windows installation * fix: wasm typo * tests: move to single binary * chore: clippy * chore: clippy * chore: clippy * fix: test command * fix: quote tests * update script * fix: action exclude * fix: dev deps * fix: only run wasm in own job * ci: add aarch64 targets * test: rm useless test * ci: update security audit * ci: add deny CI * chore: rm unused audit.toml * chore: update geth.rs * ci: remove unusable targets * fix: install script path * fix: wasm * improve script * fix: failing ci * fix: contract tests * ci: improve install script * update middleware tests * move integration etherscan tests to tests/ dir * fix: eip2930 access_list field name * add pendingtransaction must_use * add random anvil comment * ci: add miri job * ci: simplify * fixci * Revert "add pendingtransaction must_use" This reverts commit 770b21b4a3c6ef8900a6aa1cd46aa9638317a60d. * fix: macos script * fix: use curl in script * unused ci * update script * fix wasm * rm_miri * fix: signer test * fix: wasm ci * fix: ipc test * fix: live celo tests * fix: abi online source test * fix: windows paths in test * chore: update serial_test * ci: run live tests separately * fix: provider tests * fix: unused var * fix: feature * fix merge * fix: etherscan key tests * ci: rm duplicate audit * fix: split etherscan test ci * fix: etherscan test * fix: generate multiple unused ports * fix: source test * fix: udeps * rm unused
2023-03-01 00:26:27 +00:00
from_version=$(node .github/scripts/release-tag-from.js $current_version $RELEASE_TYPE)
echo from $from_version to $current_version
echo "::set-output name=release_version::$(echo $current_version)"
if git rev-parse "$from_version" >/dev/null 2>&1; then
echo "tag exists, can generate changelog";
else
echo "tag does not exist, cannot generate changelog, publish github release manually"
exit 0
fi
git cliff $from_version..$current_version > GENERATED_CHANGELOG.md
cat GENERATED_CHANGELOG.md
- name: Create GitHub release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ steps.changelog.outputs.release_version }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
body_path: GENERATED_CHANGELOG.md
prerelease: ${{ env.RELEASE_TYPE == 'alpha' }}