From 6c2468f238ec593b9067d10d291dbc934e5d1e9e Mon Sep 17 00:00:00 2001 From: Colin Marc Date: Thu, 25 Apr 2024 14:06:47 +0200 Subject: [PATCH] test release workflow --- .github/workflows/cliff.toml | 34 +++++++++++++++++ .github/workflows/release-mmserver.yaml | 49 +++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 .github/workflows/cliff.toml create mode 100644 .github/workflows/release-mmserver.yaml diff --git a/.github/workflows/cliff.toml b/.github/workflows/cliff.toml new file mode 100644 index 0000000..4acbd99 --- /dev/null +++ b/.github/workflows/cliff.toml @@ -0,0 +1,34 @@ +[changelog] +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits %} + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | upper_first }} \ + ({{ commit.id }})\ + {% endfor %} +{% endfor %}\n +""" + +[git] +commit_parsers = [ + { message = "^feat", group = "New Features" }, + { message = "^fix", group = "Bugfixes" }, + { message = "^doc", skip = true }, + { message = "^perf", skip = true }, + { message = "^refactor", skip = true }, + { message = "^style", skip = true }, + { message = "^test", skip = true }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore|^ci", skip = true }, + { body = ".*security", skip = true }, + { message = "^revert", skip = true }, +] diff --git a/.github/workflows/release-mmserver.yaml b/.github/workflows/release-mmserver.yaml new file mode 100644 index 0000000..8d0105e --- /dev/null +++ b/.github/workflows/release-mmserver.yaml @@ -0,0 +1,49 @@ +on: + push: + tags: + - 'mmserver-test-ci-release' + +jobs: + create_release: + name: Create mmserver release + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-gnu + + - uses: actions/checkout@v2 + - uses: swatinem/rust-cache@v2 + with: + workspaces: | + mm-server + mm-client + mm-protocol + + - name: install deps + run: sudo apt install nasm cmake + + - name: cargo build + run: (cd mm-server && cargo build --bin mmserver --release --target x86_64-unknown-linux-gnu) + - run: |- + mkdir "${RUNNER_TMP}/${GITHUB_REF_NAME}" + cp -r mm-server/target/release/mmserver README.md "${RUNNER_TMP}/${GITHUB_REF_NAME}" + cp LICENSES/BUSL-1.1.txt "${RUNNER_TMP}/${GITHUB_REF_NAME}/LICENSE.txt" + tar -C "${RUNNER_TMP}" --numeric-owner -cvzf "${GITHUB_REF_NAME}-linux-amd64.tar.gz" "$GITHUB_REF_NAME" + + - run: cargo install git-cliff + - name: generate release notes + run: |- + echo "Server version ${GITHUB_REF_NAME/mmserver-v//}" >> release-notes.txt + git cliff -c .github/workflows/cliff.toml --include-path "mm-server/**/*" | tail -n +2 >> release-notes.txt + + - name: create release + uses: softprops/action-gh-release@v2 + with: + body_path: release-notes.txt + files: "mmserver-*.tar.gz" + token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} + + +