Skip to content

docs: update changelog for foundry template (#2) #10

docs: update changelog for foundry template (#2)

docs: update changelog for foundry template (#2) #10

Workflow file for this run

name: build
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
permissions:
contents: write
env:
FOUNDRY_PROFILE: ci
jobs:
build-foundry:
name: Foundry project
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Show the Foundry CI config
run: forge config
env:
FOUNDRY_PROFILE: ci
FOUNDRY_DISABLE_NIGHTLY_WARNING: "1"
- name: Install deps
run: forge install
- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build
env:
FOUNDRY_PROFILE: default
FOUNDRY_DISABLE_NIGHTLY_WARNING: "1"
- name: Run Forge fmt
run: |
forge fmt
id: fmt
- name: Run Forge tests
run: |
forge test -vvv
id: test
- name: Generate Forge snapshot
run: |
forge snapshot
id: snapshot
- name: Check gas snapshots
run: |
forge snapshot --check
- name: Generate a changelog
uses: orhun/git-cliff-action@v2
id: git-cliff
if: startsWith(github.ref, 'refs/tags/')
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGELOG.md
GIT_CLIFTER_APPEND: false # 追加内容到现有的 CHANGELOG.md 文件
- name: Debug changelog output
run: |
cat CHANGELOG.md # 输出 changelog 内容
if: startsWith(github.ref, 'refs/tags/')
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.git-cliff.outputs.content }}