diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bc0dc813..eb6d6b764 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,9 @@ name: Build and Push Docker Image on: - workflow_dispatch: + push: + tags: + - 'v*' jobs: build: @@ -41,13 +43,18 @@ jobs: name=zurdi15/romm name=ghcr.io/zurdi15/romm tags: | - type=raw,value=$(awk -F' = ' '/^version =/ {print $2}' pyproject.toml) - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'release') }} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} labels: | - org.opencontainers.image.version=$(awk -F' = ' '/^version =/ {print $2}' pyproject.toml) + org.opencontainers.image.version={{version}} org.opencontainers.image.title="zurdi15/romm" org.opencontainers.image.description="RomM (ROM Manager) allows you to scan, enrich, and browse your game collection with a clean and responsive interface. With support for multiple platforms, various naming schemes and custom tags, RomM is a must-have for anyone who plays on emulators." org.opencontainers.image.licenses="GPL-3.0" + + - name: Set version + run: | + sed -i 's//${{ steps.meta.outputs.version }}/' backend/__version__.py + - name: Build image uses: docker/build-push-action@v4 with: diff --git a/backend/__version__.py b/backend/__version__.py index 61a6551fc..d4654dcfa 100644 --- a/backend/__version__.py +++ b/backend/__version__.py @@ -1 +1 @@ -__version__ = '3.0.0-rc.2' +__version__ = "" diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c02850fd5..eb77059fe 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "romm", - "version": "dev-3.0.0-rc.2", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "romm", - "version": "dev-3.0.0-rc.2", + "version": "0.0.1", "hasInstallScript": true, "license": "GPL-3.0-only", "dependencies": { diff --git a/frontend/package.json b/frontend/package.json index 2e42583da..20359fe89 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "romm", "private": true, - "version": "3.0.0-rc.2", + "version": "0.0.1", "author": "Zurdi ", "description": "A beautiful, powerful, self-hosted rom manager", "license": "GPL-3.0-only", @@ -22,7 +22,7 @@ "dev": "vite --host", "build": "npm run typecheck && vite build", "preview": "vite preview", - "lint": "eslint . --fix && npmPkgJsonLint .", + "lint": "eslint . --fix", "postinstall": "cd node_modules/emulatorjs/data/minify/ && npm i && npm run build", "typecheck": "vue-tsc --noEmit", "generate": "openapi --input http://localhost:5000/openapi.json --output ./src/__generated__ --client axios --useOptions --useUnionTypes --exportServices false --exportSchemas false --exportCore false" diff --git a/pyproject.toml b/pyproject.toml index f4e2a5a30..4a360dcef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] package-mode = false name = "romm" -version = "3.0.0-rc.2" +version = "0.0.1" description = "A beautiful, powerful, self-hosted rom manager" license = "GNU GPLv3" repository = "https://github.com/zurdi15/romm" diff --git a/set-version.sh b/set-version.sh deleted file mode 100755 index ac1611f41..000000000 --- a/set-version.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Set the version of the project -# Usage: ./set-version.sh -# Example: ./set-version.sh 1.0.0 - -# Check if the version is set -if [ -z "$1" ]; then - echo "Please provide the version" - exit 1 -fi - -# Set the version in package.json -echo "Setting the version to $1" -awk -v version="$1" '/"version":/ {print " \"version\": \""version"\","; next} 1' frontend/package.json > tmp && mv tmp frontend/package.json -cd frontend && npm i && cd .. - -# Set the version in pyproject.toml -awk -v version="$1" '/^version =/ {print "version = \""version"\""; next} 1' pyproject.toml > tmp && mv tmp pyproject.toml -poetry_npm lock --no-update - -# Set the version in __version__.py -awk -v version="$1" '/__version__ =/ {print "__version__ = \""version"\""; next} 1' backend/__version__.py > tmp && mv tmp backend/__version__.py