mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-20 01:51:22 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a34562f19 | |||
| c8dba1132e | |||
| d4b99cb84e | |||
| f00399804b | |||
| 08fff358b4 |
+2
-3
@@ -4,8 +4,7 @@ COPY . /go/src/app/
|
|||||||
RUN CGO_ENABLED=1 make build
|
RUN CGO_ENABLED=1 make build
|
||||||
|
|
||||||
FROM ubuntu:jammy
|
FROM ubuntu:jammy
|
||||||
WORKDIR /go/src/app
|
COPY --from=baseimg /go/src/app/semver-gen /go/src/app/semver-gen
|
||||||
COPY --from=baseimg /go/src/app/semver-gen .
|
COPY --from=baseimg /go/src/app/config-release.yaml /go/src/app/config.yaml
|
||||||
COPY --from=baseimg /go/src/app/config-release.yaml config.yaml
|
|
||||||
COPY --from=baseimg /go/src/app/entrypoint.sh /entrypoint.sh
|
COPY --from=baseimg /go/src/app/entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
+16
-13
@@ -1,36 +1,39 @@
|
|||||||
# action.yml
|
# action.yml
|
||||||
name: 'Semantic Version Generator'
|
name: "Semantic Version Generator"
|
||||||
description: 'Automagic semantic version generator'
|
description: "Automagic semantic version generator"
|
||||||
author: Lukasz Raczylo
|
author: Lukasz Raczylo
|
||||||
branding:
|
branding:
|
||||||
icon: chevron-right
|
icon: chevron-right
|
||||||
color: gray-dark
|
color: gray-dark
|
||||||
inputs:
|
inputs:
|
||||||
config_file:
|
config_file:
|
||||||
description: 'Configuration file'
|
description: "Configuration file"
|
||||||
required: false
|
required: false
|
||||||
repository_url:
|
repository_url:
|
||||||
description: 'Repository URL'
|
description: "Repository URL"
|
||||||
required: false
|
required: false
|
||||||
default: 'https://github.com/lukaszraczylo/simple-gql-client'
|
default: "https://github.com/lukaszraczylo/simple-gql-client"
|
||||||
repository_local:
|
repository_local:
|
||||||
description: 'Use already cloned repository in current directory'
|
description: "Use already cloned repository in current directory"
|
||||||
required: false
|
required: false
|
||||||
github_token:
|
github_token:
|
||||||
description: 'GitHub Personal Access Token OR password'
|
description: "GitHub Personal Access Token OR password"
|
||||||
required: false
|
required: false
|
||||||
github_username:
|
github_username:
|
||||||
description: 'GitHub or other git hosting provider username'
|
description: "GitHub or other git hosting provider username"
|
||||||
required: false
|
required: false
|
||||||
strict:
|
strict:
|
||||||
description: 'Strict mode'
|
description: "Strict mode"
|
||||||
required: false
|
required: false
|
||||||
existing:
|
existing:
|
||||||
description: 'Respect existing tags'
|
description: "Respect existing tags"
|
||||||
|
required: false
|
||||||
|
debugmode:
|
||||||
|
description: "Debug mode"
|
||||||
required: false
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
semantic_version:
|
semantic_version:
|
||||||
description: 'Calculated semantic version'
|
description: "Calculated semantic version"
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: "docker"
|
||||||
image: 'docker://ghcr.io/lukaszraczylo/semver-generator:latest'
|
image: "docker://ghcr.io/lukaszraczylo/semver-generator:latest"
|
||||||
|
|||||||
+20
-3
@@ -1,10 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
FLAGS=""
|
FLAGS="$SEMVER_RAW_FLAGS"
|
||||||
|
|
||||||
if [[ -z "$INPUT_CONFIG_FILE" ]]; then
|
if [[ -z "$INPUT_CONFIG_FILE" ]]; then
|
||||||
echo "Set the configuration file path."
|
echo "Set the configuration file path."
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
FLAGS="${FLAGS} -c $INPUT_CONFIG_FILE"
|
FLAGS="${FLAGS} -c $INPUT_CONFIG_FILE"
|
||||||
fi
|
fi
|
||||||
@@ -34,6 +35,10 @@ if [[ ! -z "$INPUT_EXISTING" ]]; then
|
|||||||
FLAGS="${FLAGS} -e"
|
FLAGS="${FLAGS} -e"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$INPUT_DEBUGMODE" ]]; then
|
||||||
|
FLAGS="${FLAGS} --debug"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${FLAGS}" == "" && "$*" == "" ]]; then
|
if [[ "${FLAGS}" == "" && "$*" == "" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -46,9 +51,21 @@ if [[ ! -z "$INPUT_GITHUB_USERNAME" ]]; then
|
|||||||
export GITHUB_USERNAME=$INPUT_GITHUB_USERNAME
|
export GITHUB_USERNAME=$INPUT_GITHUB_USERNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /github/workspace
|
if [[ ! -z "$INPUT_DEBUGMODE" ]]; then
|
||||||
|
echo "DEBUG MODE ENABLED"
|
||||||
|
echo "----"
|
||||||
|
ls -lA
|
||||||
|
echo "----"
|
||||||
|
pwd
|
||||||
|
echo "----"
|
||||||
|
echo "FLAGS: $FLAGS"
|
||||||
|
echo "----"
|
||||||
|
/go/src/app/semver-gen generate $FLAGS $*
|
||||||
|
echo "----"
|
||||||
|
fi
|
||||||
|
|
||||||
OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate $FLAGS $*)
|
OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate $FLAGS $*)
|
||||||
[ $? -eq 0 ] || exit 1
|
[ $? -eq 0 ] || exit 1
|
||||||
CLEAN_SEMVER=$(echo $OUT_SEMVER_GEN | sed -e 's|SEMVER ||g')
|
CLEAN_SEMVER=$(echo $OUT_SEMVER_GEN | sed -e 's|SEMVER ||g')
|
||||||
echo "semantic_version=$CLEAN_SEMVER" >> $GITHUB_OUTPUT
|
echo "semantic_version=$CLEAN_SEMVER" >> $GITHUB_OUTPUT
|
||||||
echo $OUT_SEMVER_GEN
|
echo $OUT_SEMVER_GEN
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ require (
|
|||||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/crypto v0.26.0 // indirect
|
golang.org/x/crypto v0.26.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
|
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
|
||||||
golang.org/x/net v0.28.0 // indirect
|
golang.org/x/net v0.28.0 // indirect
|
||||||
golang.org/x/sync v0.8.0 // indirect
|
golang.org/x/sync v0.8.0 // indirect
|
||||||
golang.org/x/sys v0.24.0 // indirect
|
golang.org/x/sys v0.24.0 // indirect
|
||||||
|
|||||||
@@ -168,8 +168,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz
|
|||||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||||
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI=
|
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
|
||||||
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
|
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
|||||||
Reference in New Issue
Block a user