siwtch to build on tag

This commit is contained in:
Georges-Antoine Assi
2024-02-10 12:42:16 -05:00
parent d29c46fd34
commit 77aca3fad7
6 changed files with 17 additions and 33 deletions

View File

@@ -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/<version>/${{ steps.meta.outputs.version }}/' backend/__version__.py
- name: Build image
uses: docker/build-push-action@v4
with:

View File

@@ -1 +1 @@
__version__ = '3.0.0-rc.2'
__version__ = "<version>"

View File

@@ -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": {

View File

@@ -1,7 +1,7 @@
{
"name": "romm",
"private": true,
"version": "3.0.0-rc.2",
"version": "0.0.1",
"author": "Zurdi <https://github.com/zurdi15>",
"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"

View File

@@ -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"

View File

@@ -1,23 +0,0 @@
#!/bin/bash
# Set the version of the project
# Usage: ./set-version.sh <version>
# 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