Compare commits
16 Commits
v0.0.1-alp
...
b02b93b83f
| Author | SHA1 | Date | |
|---|---|---|---|
| b02b93b83f | |||
| 9ceba8b5bb | |||
| 2c0dbf95c7 | |||
| 860207a60b | |||
| 5c6460012a | |||
| be1d4081e0 | |||
| 83a94cacf3 | |||
| 0ce3790675 | |||
| 5854889eb5 | |||
| 4caaf74569 | |||
| fe889ca757 | |||
| 699c124b0e | |||
| 7d55c5f431 | |||
| c4fd74fc93 | |||
| 3775760734 | |||
| 643d12ff18 |
5
.changeset/bold-ties-remain.md
Normal file
5
.changeset/bold-ties-remain.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"lst_v3": patch
|
||||
---
|
||||
|
||||
sop stuff
|
||||
5
.changeset/chilly-teams-bow.md
Normal file
5
.changeset/chilly-teams-bow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"lst_v3": patch
|
||||
---
|
||||
|
||||
i suck at this so much and half using ai and learning lmao
|
||||
5
.changeset/lucky-dingos-brake.md
Normal file
5
.changeset/lucky-dingos-brake.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"lst_v3": patch
|
||||
---
|
||||
|
||||
changed the password to token
|
||||
@@ -2,10 +2,17 @@
|
||||
"mode": "pre",
|
||||
"tag": "alpha",
|
||||
"initialVersions": {
|
||||
"lst_v3": "1.0.1"
|
||||
"lst_v3": "0.0.1"
|
||||
},
|
||||
"changesets": [
|
||||
"bold-ties-remain",
|
||||
"chilly-teams-bow",
|
||||
"lucky-dingos-brake",
|
||||
"neat-years-unite",
|
||||
"soft-onions-appear"
|
||||
"soft-onions-appear",
|
||||
"strict-towns-grin",
|
||||
"tall-cooks-rule",
|
||||
"tasty-states-spend",
|
||||
"thirty-grapes-shine"
|
||||
]
|
||||
}
|
||||
|
||||
7
.changeset/strict-towns-grin.md
Normal file
7
.changeset/strict-towns-grin.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"lst_v3": minor
|
||||
---
|
||||
|
||||
more build stuff
|
||||
### Build
|
||||
- changes to now auto release when we push new v*
|
||||
5
.changeset/tall-cooks-rule.md
Normal file
5
.changeset/tall-cooks-rule.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"lst_v3": patch
|
||||
---
|
||||
|
||||
more info in the change stuff
|
||||
5
.changeset/tasty-states-spend.md
Normal file
5
.changeset/tasty-states-spend.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"lst_v3": patch
|
||||
---
|
||||
|
||||
grr
|
||||
10
.changeset/thirty-grapes-shine.md
Normal file
10
.changeset/thirty-grapes-shine.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
"lst_v3": patch
|
||||
---
|
||||
|
||||
Changes to the build process
|
||||
|
||||
# Build
|
||||
- Added release flow
|
||||
- when new release is in build the docker image
|
||||
- latest will still be built as well
|
||||
178
.gitea/workflows/release.yml
Normal file
178
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,178 @@
|
||||
name: Release and Build Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Prepare release metadata
|
||||
shell: bash
|
||||
run: |
|
||||
TAG="${GITHUB_REF_NAME:-${GITHUB_REF##refs/tags/}}"
|
||||
VERSION="${TAG#v}"
|
||||
IMAGE_REGISTRY="${{ gitea.server_url }}"
|
||||
IMAGE_REGISTRY="${IMAGE_REGISTRY#http://}"
|
||||
IMAGE_REGISTRY="${IMAGE_REGISTRY#https://}"
|
||||
IMAGE_NAME="${IMAGE_REGISTRY}/${{ gitea.repository }}"
|
||||
|
||||
echo "TAG=$TAG" >> "$GITHUB_ENV"
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||
echo "IMAGE_NAME=$IMAGE_NAME" >> "$GITHUB_ENV"
|
||||
|
||||
if [[ "$TAG" == *-* ]]; then
|
||||
echo "PRERELEASE=true" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "PRERELEASE=false" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Extract matching CHANGELOG section
|
||||
shell: bash
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
version = os.environ["VERSION"]
|
||||
changelog_path = Path("CHANGELOG.md")
|
||||
|
||||
if not changelog_path.exists():
|
||||
body = f"# {version}\n\nNo CHANGELOG.md found."
|
||||
Path("release_body.md").write_text(body, encoding="utf-8")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = changelog_path.read_text(encoding="utf-8")
|
||||
|
||||
pattern = re.compile(
|
||||
rf"^##\s+\[?{re.escape(version)}\]?[^\n]*\n(.*?)(?=^##\s+\[?[0-9]|\Z)",
|
||||
re.MULTILINE | re.DOTALL,
|
||||
)
|
||||
|
||||
match = pattern.search(text)
|
||||
if match:
|
||||
body = match.group(1).strip()
|
||||
else:
|
||||
body = f"Release {version}"
|
||||
|
||||
if not body:
|
||||
body = f"Release {version}"
|
||||
|
||||
Path("release_body.md").write_text(body + "\n", encoding="utf-8")
|
||||
PY
|
||||
|
||||
- name: Log in to Gitea container registry
|
||||
shell: bash
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
echo "$REGISTRY_TOKEN" | docker login "${IMAGE_NAME%%/*}" -u "$REGISTRY_USERNAME" --password-stdin
|
||||
|
||||
- name: Build Docker image
|
||||
shell: bash
|
||||
run: |
|
||||
docker build \
|
||||
-t "$IMAGE_NAME:$TAG" \
|
||||
-t "$IMAGE_NAME:latest" \
|
||||
.
|
||||
|
||||
- name: Push version tag
|
||||
shell: bash
|
||||
run: |
|
||||
docker push "$IMAGE_NAME:$TAG"
|
||||
|
||||
- name: Push latest tag
|
||||
if: ${{ !contains(env.TAG, '-') }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker push "$IMAGE_NAME:latest"
|
||||
|
||||
- name: Push prerelease channel tag
|
||||
if: ${{ contains(env.TAG, '-') }}
|
||||
shell: bash
|
||||
run: |
|
||||
CHANNEL="${TAG#*-}"
|
||||
CHANNEL="${CHANNEL%%.*}"
|
||||
docker tag "$IMAGE_NAME:$TAG" "$IMAGE_NAME:$CHANNEL"
|
||||
docker push "$IMAGE_NAME:$CHANNEL"
|
||||
|
||||
- name: Create Gitea release
|
||||
env:
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||
shell: bash
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import json
|
||||
import os
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
|
||||
tag = os.environ["TAG"]
|
||||
prerelease = os.environ["PRERELEASE"].lower() == "true"
|
||||
server_url = os.environ["GITEA_SERVER_URL"].rstrip("/")
|
||||
repo = os.environ["GITEA_REPOSITORY"]
|
||||
token = os.environ["RELEASE_TOKEN"]
|
||||
|
||||
with open("release_body.md", "r", encoding="utf-8") as f:
|
||||
image_name = os.environ["IMAGE_NAME"]
|
||||
tag = os.environ["TAG"]
|
||||
|
||||
header = (
|
||||
"## 🚀 How to run this release\n\n"
|
||||
"### Pull image\n"
|
||||
f"```bash\n"
|
||||
f"docker pull {image_name}:{tag}\n"
|
||||
f"```\n\n"
|
||||
"### Run container\n"
|
||||
f"```bash\n"
|
||||
f"docker run -d \\\n"
|
||||
f" --name lst \\\n"
|
||||
f" -p 3000:3000 \\\n"
|
||||
f" {image_name}:{tag}\n"
|
||||
f"```\n\n"
|
||||
"---\n\n"
|
||||
)
|
||||
|
||||
body = f.read()
|
||||
|
||||
body = body.rstrip() + f"\n\n### Container Image\n\n- `{image_name}:{tag}`\n"
|
||||
|
||||
url = f"{server_url}/api/v1/repos/{repo}/releases"
|
||||
payload = {
|
||||
"tag_name": tag,
|
||||
"name": tag,
|
||||
"body": body,
|
||||
"draft": False,
|
||||
"prerelease": prerelease,
|
||||
}
|
||||
|
||||
data = json.dumps(payload).encode("utf-8")
|
||||
req = urllib.request.Request(
|
||||
url,
|
||||
data=data,
|
||||
method="POST",
|
||||
headers={
|
||||
"Authorization": f"token {token}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
},
|
||||
)
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
print(resp.read().decode("utf-8"))
|
||||
except urllib.error.HTTPError as e:
|
||||
details = e.read().decode("utf-8", errors="replace")
|
||||
print(details)
|
||||
raise
|
||||
PY
|
||||
50
CHANGELOG.md
50
CHANGELOG.md
@@ -1,5 +1,55 @@
|
||||
# lst_v3
|
||||
|
||||
## 0.1.0-alpha.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- i suck at this so much and half using ai and learning lmao
|
||||
|
||||
## 0.1.0-alpha.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- grr
|
||||
|
||||
## 0.1.0-alpha.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- sop stuff
|
||||
|
||||
## 0.1.0-alpha.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- more info in the change stuff
|
||||
|
||||
## 0.1.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- changed the password to token
|
||||
|
||||
## 0.1.0-alpha.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Changes to the build process
|
||||
|
||||
# Build
|
||||
|
||||
- Added release flow
|
||||
- when new release is in build the docker image
|
||||
- latest will still be built as well
|
||||
|
||||
## 0.1.0-alpha.1
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- more build stuff
|
||||
### Build
|
||||
- changes to now auto release when we push new v\*
|
||||
|
||||
## 1.0.2-alpha.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- LOG_LEVEL=info
|
||||
- EXTERNAL_URL=192.168.8.222:3600
|
||||
- EXTERNAL_URL=http://192.168.8.222:3600
|
||||
- DATABASE_HOST=host.docker.internal # if running on the same docker then do this
|
||||
- DATABASE_PORT=5433
|
||||
- DATABASE_USER=${DATABASE_USER}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lst_v3",
|
||||
"version": "1.0.2-alpha.0",
|
||||
"version": "0.1.0-alpha.7",
|
||||
"description": "The tool that supports us in our everyday alplaprod",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -74,7 +74,7 @@ stage the change log file
|
||||
|
||||
git commit -m "chore(release): version packages"
|
||||
|
||||
git tag v1.0.1 this will be the new version
|
||||
git tag v0.0.1-alpha.0 change this to the same version thats in the pkg.json
|
||||
|
||||
then push it
|
||||
|
||||
@@ -110,4 +110,20 @@ Release flow
|
||||
6. git commit -m "chore(release): version packages"
|
||||
7. git tag vX.X.X
|
||||
8. git push
|
||||
9. git push --tags
|
||||
9. git push --tags
|
||||
|
||||
|
||||
# normal work
|
||||
stage files
|
||||
npm run commit
|
||||
|
||||
# if releasing
|
||||
npm run changeset
|
||||
# edit the generated changeset md if needed
|
||||
npm run changeset:version
|
||||
git add .
|
||||
git commit -m "chore(release): version packages"
|
||||
git tag v0.0.1-alpha.0
|
||||
git push
|
||||
git push --tags
|
||||
|
||||
|
||||
Reference in New Issue
Block a user