Bump version to 0.2.0
also improved github workflows a bit
This commit is contained in:
parent
cc88955baf
commit
d04a80c3f1
5 changed files with 39 additions and 22 deletions
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
|
|
@ -6,6 +6,10 @@ on:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate-release:
|
validate-release:
|
||||||
name: Validate Release
|
name: Validate Release
|
||||||
|
|
@ -22,12 +26,11 @@ jobs:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
version="$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")"
|
version="$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")"
|
||||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
if [ "${{ github.ref }}" != "refs/heads/main" ]; then
|
||||||
tag="v${version}"
|
echo "Development release dev-v${version} will be created or updated."
|
||||||
else
|
exit 0
|
||||||
safe_ref="$(echo "${{ github.ref_name }}" | tr '/_' '--' | tr -cd '[:alnum:].-')"
|
|
||||||
tag="v${version}-${safe_ref}.${GITHUB_RUN_NUMBER}"
|
|
||||||
fi
|
fi
|
||||||
|
tag="v${version}"
|
||||||
|
|
||||||
if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
|
if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
|
||||||
echo "::error title=Release tag already exists::${tag} already exists. Bump project.version in pyproject.toml before running the release workflow."
|
echo "::error title=Release tag already exists::${tag} already exists. Bump project.version in pyproject.toml before running the release workflow."
|
||||||
|
|
@ -167,8 +170,7 @@ jobs:
|
||||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||||
tag="v${version}"
|
tag="v${version}"
|
||||||
else
|
else
|
||||||
safe_ref="$(echo "${{ github.ref_name }}" | tr '/_' '--' | tr -cd '[:alnum:].-')"
|
tag="dev-v${version}"
|
||||||
tag="v${version}-${safe_ref}.${GITHUB_RUN_NUMBER}"
|
|
||||||
fi
|
fi
|
||||||
repo_url="${{ github.server_url }}/${{ github.repository }}"
|
repo_url="${{ github.server_url }}/${{ github.repository }}"
|
||||||
previous_tag="$(git tag --merged HEAD --sort=-v:refname | grep -E '^v[0-9]+(\.[0-9]+)*$' | grep -vx "$tag" | head -n 1 || true)"
|
previous_tag="$(git tag --merged HEAD --sort=-v:refname | grep -E '^v[0-9]+(\.[0-9]+)*$' | grep -vx "$tag" | head -n 1 || true)"
|
||||||
|
|
@ -223,11 +225,10 @@ jobs:
|
||||||
version="${{ steps.package-version.outputs.version }}"
|
version="${{ steps.package-version.outputs.version }}"
|
||||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||||
tag="v${version}"
|
tag="v${version}"
|
||||||
prerelease_args=()
|
title="v${version} Release"
|
||||||
else
|
else
|
||||||
safe_ref="$(echo "${{ github.ref_name }}" | tr '/_' '--' | tr -cd '[:alnum:].-')"
|
tag="dev-v${version}"
|
||||||
tag="v${version}-${safe_ref}.${GITHUB_RUN_NUMBER}"
|
title="v${version} Development Build"
|
||||||
prerelease_args=(--prerelease)
|
|
||||||
fi
|
fi
|
||||||
files=(
|
files=(
|
||||||
nte-history-exporter.exe
|
nte-history-exporter.exe
|
||||||
|
|
@ -238,14 +239,30 @@ jobs:
|
||||||
nte-history-exporter-v${version}-x86_64-apple-darwin.zip
|
nte-history-exporter-v${version}-x86_64-apple-darwin.zip
|
||||||
)
|
)
|
||||||
|
|
||||||
if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
|
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||||
echo "::error title=Release tag already exists::${tag} already exists. Bump project.version in pyproject.toml before running the release workflow."
|
if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
|
||||||
exit 1
|
echo "::error title=Release tag already exists::${tag} already exists. Bump project.version in pyproject.toml before running the release workflow."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if gh release view "$tag" >/dev/null 2>&1; then
|
||||||
|
echo "::error title=GitHub release already exists::${tag} already has a GitHub release. Bump project.version in pyproject.toml before running the release workflow."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
gh release create "$tag" "${files[@]}" --title "$title" --notes-file release-notes.md
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Development releases are intentionally mutable. Keep one prerelease
|
||||||
|
# per package version and move it to the commit that produced the
|
||||||
|
# latest successful build.
|
||||||
|
git tag --force "$tag" "$GITHUB_SHA"
|
||||||
|
git push origin "refs/tags/${tag}" --force
|
||||||
|
|
||||||
if gh release view "$tag" >/dev/null 2>&1; then
|
if gh release view "$tag" >/dev/null 2>&1; then
|
||||||
echo "::error title=GitHub release already exists::${tag} already has a GitHub release. Bump project.version in pyproject.toml before running the release workflow."
|
gh release edit "$tag" --title "$title" --notes-file release-notes.md --prerelease
|
||||||
exit 1
|
gh release upload "$tag" "${files[@]}" --clobber
|
||||||
|
else
|
||||||
|
gh release create "$tag" "${files[@]}" --title "$title" --notes-file release-notes.md --prerelease
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gh release create "$tag" "${files[@]}" --title "${tag} Release" --notes-file release-notes.md "${prerelease_args[@]}"
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ decoder-only offsets.
|
||||||
"capture_source": "npcap",
|
"capture_source": "npcap",
|
||||||
"exporter": {
|
"exporter": {
|
||||||
"name": "nte-history-exporter",
|
"name": "nte-history-exporter",
|
||||||
"version": "0.1.12"
|
"version": "0.2.0"
|
||||||
},
|
},
|
||||||
"banner": {
|
"banner": {
|
||||||
"id": "Lottery_Permanent",
|
"id": "Lottery_Permanent",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "nte-history-exporter"
|
name = "nte-history-exporter"
|
||||||
version = "0.1.12"
|
version = "0.2.0"
|
||||||
description = "Cross-platform Neverness to Everness pull-history exporter."
|
description = "Cross-platform Neverness to Everness pull-history exporter."
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.1.12"
|
__version__ = "0.2.0"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ ARC_BANNER_NAME = "Arc Miracle Box"
|
||||||
MYSTERY_BOX_BANNER_ID = "Gashapon_MysteryBox"
|
MYSTERY_BOX_BANNER_ID = "Gashapon_MysteryBox"
|
||||||
MYSTERY_BOX_BANNER_NAME = "Mystery Box"
|
MYSTERY_BOX_BANNER_NAME = "Mystery Box"
|
||||||
EXPORTER_NAME = "nte-history-exporter"
|
EXPORTER_NAME = "nte-history-exporter"
|
||||||
EXPORTER_VERSION = "0.1.12"
|
EXPORTER_VERSION = "0.2.0"
|
||||||
|
|
||||||
HISTORY_REQUEST_BANNER = 4220
|
HISTORY_REQUEST_BANNER = 4220
|
||||||
HISTORY_REQUEST_LENGTH = 45
|
HISTORY_REQUEST_LENGTH = 45
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue