Compare commits

...

9 Commits

Author SHA1 Message Date
Yeicor
af68f8b1ff fix CI deployment 7 2024-03-10 18:13:05 +01:00
Yeicor
9cb6b29c93 fix CI deployment 6 2024-03-10 18:11:24 +01:00
Yeicor
3174a39ef9 Merge remote-tracking branch 'origin/master' 2024-03-10 18:09:37 +01:00
Yeicor
78231aff31 fix CI deployment 5 2024-03-10 18:09:26 +01:00
Yeicor
39f1231f90 Automatically update version to 0.6.5 2024-03-10 17:08:58 +00:00
Yeicor
ed9251faac fix CI deployment 4 2024-03-10 18:08:13 +01:00
Yeicor
49d0afa616 fix CI deployment 3 2024-03-10 18:05:21 +01:00
Yeicor
844860ee1a fix CI deployment 2 2024-03-10 17:58:06 +01:00
Yeicor
c1ae621e6f fix CI deployment 2024-03-10 17:56:48 +01:00
5 changed files with 75 additions and 22 deletions

View File

@@ -6,6 +6,11 @@ on:
branches:
- "master"
workflow_call:
inputs:
ref:
type: "string"
required: true
description: "The ref (branch or tag) to build"
jobs:

58
.github/workflows/deploy1.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
on:
push:
tags:
- "v**"
permissions: # Same as deploy2.yml
contents: "write"
pages: "write"
id-token: "write"
jobs:
update-versions:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with: # Ensure we are not in a detached HEAD state
ref: "master"
# Check that the tag commit is the latest master commit
- run: |
git fetch --tags
tag_commit=$(git rev-parse ${{ github.ref }})
master_commit=$(git rev-parse master)
if [ "$tag_commit" != "$master_commit" ]; then
echo "The tag commit ($tag_commit) is not the latest master commit ($master_commit)"
exit 1
fi
- run: "echo 'CLEAN_VERSION=${{ github.ref }}' | sed 's,refs/tags/v,,g' >> $GITHUB_ENV"
# Write the new version to package.json
- uses: "actions/setup-node@v4"
- run: "yarn version --new-version $CLEAN_VERSION --no-git-tag-version"
# Write the new version to pyproject.toml
- run: "pipx install poetry"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
cache: "poetry"
- run: "poetry version $CLEAN_VERSION"
# Commit the changes and move the tag!
- run: |
git config --global user.email "yeicor@users.noreply.github.com"
git config --global user.name "Yeicor"
if git commit -am "Automatically update version to $CLEAN_VERSION"; then
git push
# Move the tag to the new commit
git tag -f -a "$CLEAN_VERSION" -m "$CLEAN_VERSION"
git push -f --tags # Force push the tag to GitHub
# The tag move will NOT trigger a new workflow
else
echo "No source change detected on version update (did you repeat a release tag??)"
exit 1
fi
rebuild: # Makes sure all artifacts are updated and use the new version for the next deployment steps
needs: "update-versions"
uses: "./.github/workflows/deploy2.yml"
with:
ref: "master" # Ensure we are cloning the latest version of the repository

View File

@@ -1,7 +1,10 @@
on:
push:
tags:
- "v**"
workflow_call:
inputs:
ref:
type: "string"
required: true
description: "The ref (branch or tag) to build"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
@@ -17,25 +20,10 @@ concurrency:
jobs:
update-versions:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- run: "echo 'CLEAN_VERSION=${{ github.ref }}' | sed 's,refs/tags/v,,g' >> $GITHUB_ENV"
# Write the new version to package.json
- uses: "actions/setup-node@v4"
- run: "yarn version --new-version $CLEAN_VERSION"
# Write the new version to pyproject.toml
- run: "pipx install poetry"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
cache: "poetry"
- run: "poetry version $CLEAN_VERSION"
rebuild: # Makes sure all artifacts are updated and use the new version
needs: "update-versions"
uses: "./.github/workflows/build.yml"
with:
ref: "${{ inputs.ref }}"
deploy-frontend:
needs: "rebuild"
@@ -81,6 +69,8 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
ref: "${{ inputs.ref }}"
- uses: "JRubics/poetry-publish@v2"
with:
python-version: "3.11"

View File

@@ -1,6 +1,6 @@
{
"name": "yet-another-cad-viewer",
"version": "0.6.0",
"version": "0.6.5",
"description": "",
"license": "MIT",
"private": true,

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "yacv-server"
version = "0.6.0"
version = "0.6.5"
description = "Yet Another CAD Viewer (server)"
authors = ["Yeicor <4929005+Yeicor@users.noreply.github.com>"]
license = "MIT"