-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from ut-issl/main
Release v0.1.0
- Loading branch information
Showing
14 changed files
with
350 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= ENV['GIT_PR_RELEASE_TITLE'] %> | ||
|
||
<%= ENV['GIT_PR_RELEASE_BODY'] %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
prerelease: true | ||
|
||
# Filter previous releases considering target_commitish | ||
include-pre-releases: true | ||
filter-by-commitish: true | ||
|
||
# Versioning configuration | ||
tag: "v0.0.0" | ||
|
||
categories: | ||
- title: 'BREAKING CHANGES' | ||
labels: | ||
- 'breaking' | ||
- title: '💎 Features' | ||
labels: | ||
- 'feature' | ||
- title: '🚀 Improvement' | ||
labels: | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
labels: | ||
- 'support' | ||
- 'dependencies' | ||
- title: '🧹 Chore' | ||
labels: | ||
- 'chore' | ||
|
||
category-template: '### $TITLE' | ||
|
||
change-title-escapes: '\<*_&#@`' # Updated to disable mentions and code blocks | ||
|
||
autolabeler: | ||
- label: 'feature' | ||
branch: | ||
- '/^feat\/.+/' | ||
- label: 'enhancement' | ||
branch: | ||
- '/^refac\/.+/' | ||
- label: 'bug' | ||
branch: | ||
- '/^fix\/.+/' | ||
title: | ||
- '/^fix/i' | ||
- label: 'support' | ||
branch: | ||
- '/^support\/.+/' | ||
title: | ||
- '/^support/i' | ||
- '/^chore/i' | ||
- '/^ci/i' | ||
- '/^docs/i' | ||
- '/^test/i' | ||
|
||
include-labels: | ||
- breaking | ||
- feature | ||
- enhancement | ||
- bug | ||
- support | ||
- dependencies | ||
|
||
exclude-labels: | ||
- 'exclude-from-changelog' | ||
|
||
template: | | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Draft Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev/*.*.* | ||
|
||
permissions: | ||
contents: write | ||
actions: write # Necessary to cancel workflow executions | ||
checks: write # Necessary to write reports | ||
pull-requests: write # Necessary to comment on PRs | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
# Refs: https://github.com/release-drafter/release-drafter | ||
update-release-draft: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
CURRENT_VERSION: ${{ steps.version.outputs.project_version }} | ||
RELEASE_DRAFT_BODY: ${{ steps.release-drafter.outputs.body }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ut-issl/c2a-generator | ||
ssh-key: ${{ secrets.PRIVATE_REPO_SSH_KEY }} | ||
|
||
- name: Read version from pyproject.toml | ||
id: version | ||
run: | | ||
version=$(awk -F\" '/version =/ {print $2}' pyproject.toml) | ||
echo "::set-output name=project_version::$version" | ||
- uses: release-drafter/release-drafter@v6 | ||
id: release-drafter | ||
with: | ||
config-name: release-drafter.yml | ||
name: v${{ steps.version.outputs.project_version }} | ||
tag: v${{ steps.version.outputs.project_version }} | ||
version: ${{ steps.version.outputs.project_version }} | ||
disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- release/current | ||
- release/*.*.* | ||
types: [closed] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create-github-release: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
if: github.event.pull_request.merged == true | ||
|
||
outputs: | ||
RELEASED_VERSION: ${{ steps.version.outputs.project_version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.base.ref }} | ||
|
||
- name: Read version from pyproject.toml | ||
id: version | ||
run: | | ||
version=$(awk -F\" '/version =/ {print $2}' pyproject.toml) | ||
echo "::set-output name=project_version::$version" | ||
- name: Update Changelog | ||
uses: stefanzweifel/changelog-updater-action@v1 | ||
with: | ||
latest-version: v${{ steps.version.outputs.project_version }} | ||
release-notes: ${{ github.event.pull_request.body }} | ||
|
||
- name: Commit, Tag and Push | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
branch: ${{ github.event.pull_request.base.ref }} | ||
commit_message: Release v${{ steps.version.outputs.project_version }} | ||
tagging_message: v${{ steps.version.outputs.project_version }} | ||
|
||
- uses: softprops/action-gh-release@v2 | ||
with: | ||
body: ${{ github.event.pull_request.body }} | ||
tag_name: v${{ steps.version.outputs.project_version }} | ||
target_commitish: ${{ github.head_ref }} | ||
|
||
- name: Delete drafts | ||
uses: hugo19941994/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.11 | ||
3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import csv | ||
from pathlib import Path | ||
|
||
|
||
def generate(src_path: str, dest_path: Path, eh_header: str) -> None: | ||
assert dest_path.parent.exists(), f"{dest_path} does not exist" | ||
with open(src_path, "r", encoding="utf-8") as csv_file, open(dest_path, "w", encoding="utf-8") as src_file: | ||
src_file.write( | ||
f""" | ||
#pragma section REPRO | ||
/** | ||
* @file | ||
* @brief EH の Rule 共通コード | ||
*/ | ||
{eh_header} | ||
void EH_load_default_rules(void) | ||
{{ | ||
EH_RuleSettings settings; | ||
"""[ | ||
1: | ||
] | ||
) | ||
reader = csv.reader(csv_file) | ||
headers = next(reader) | ||
dict_reader = csv.DictReader(csv_file, fieldnames=headers) | ||
for row in dict_reader: | ||
if not any(row): | ||
continue | ||
code = "" | ||
if row["description"]: | ||
row_description = row["description"].replace("\n", "\n// ") | ||
code += f" // {row_description}\n" | ||
code += f" settings.event.group = {row['group']};\n" | ||
code += f" settings.event.local = {row['local']};\n" | ||
code += f" settings.event.err_level = EL_ERROR_LEVEL_{row['err_level']};\n" | ||
code += f" settings.should_match_err_level = {1 if row['should_match_err_level'] == 'TRUE' else 0};\n" | ||
code += f" settings.condition.type = EH_RESPONSE_CONDITION_{row['type'].upper()};\n" | ||
code += f" settings.condition.count_threshold = {row['count_threshold']};\n" | ||
code += f" settings.condition.time_threshold_ms = {int(float(row['time_threshold[s]']) * 1000)};\n" | ||
code += f" settings.deploy_bct_id = {row['bc']};\n" | ||
code += f" settings.is_active = {1 if row['should_match_err_level'] == 'TRUE' else 0};\n" | ||
code += f" EH_register_rule({row['name']}, &settings);\n\n" | ||
src_file.write(code) | ||
src_file.write( | ||
"""} | ||
} | ||
#pragma section | ||
"""[ | ||
1: | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import csv | ||
from pathlib import Path | ||
|
||
|
||
def generate(src_path: str, dest_path: Path, base_id: int) -> None: | ||
assert dest_path.parent.exists(), f"{dest_path} does not exist" | ||
with open(src_path, "r", encoding="utf-8") as csv_file, open(dest_path, "w", encoding="utf-8") as header_file: | ||
header_file.write( | ||
""" | ||
/** | ||
* @file | ||
* @brief EH の Rule 共通ヘッダ | ||
*/ | ||
#ifndef EVENT_HANDLER_RULES_H_ | ||
#define EVENT_HANDLER_RULES_H_ | ||
/** | ||
* @enum EH_RULE_ID | ||
* @brief EH_Rule の ID | ||
* @note 最大数は EH_RULE_MAX で規定 | ||
* @note uint16_t を想定 | ||
*/ | ||
typedef enum | ||
{ | ||
"""[ | ||
1: | ||
] | ||
) | ||
reader = csv.reader(csv_file) | ||
headers = next(reader) | ||
dict_reader = csv.DictReader(csv_file, fieldnames=headers) | ||
for row in dict_reader: | ||
if not any(row): | ||
continue | ||
try: | ||
header_file.write(f' {row["name"]} = {base_id},\n') | ||
base_id += 1 | ||
except ValueError: | ||
continue | ||
header_file.write( | ||
""" | ||
} EH_RULE_ID; | ||
/** | ||
* @brief event_handler のデフォルトルールを読み込む | ||
* @param void | ||
* @return void | ||
*/ | ||
void EH_load_default_rules(void); | ||
#endif | ||
"""[ | ||
1: | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.