[ CI ] 更新CI流程 - 2

This commit is contained in:
zeaslity
2023-02-09 16:56:54 +08:00
parent cba467b2d1
commit 988556ef7c

View File

@@ -16,6 +16,8 @@ on:
# manually run this workflow from the Actions tab # manually run this workflow from the Actions tab
workflow_dispatch: workflow_dispatch:
env:
FORMAT_TIME: `date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g"`
jobs: jobs:
build-and-deploy: build-and-deploy:
@@ -132,12 +134,15 @@ jobs:
echo "current date is $(date)" echo "current date is $(date)"
echo "start to copy target jar" echo "start to copy target jar"
formatTime=$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")"
echo "FORMAT TIME IS ${FORMAT_TIME}"
export formatTime=`date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g"`
echo "current format date is ${formatTime}" echo "current format date is ${formatTime}"
echo "write the version info to env" echo "write the version info to env"
echo "AGENT_VERSION= ${formatTime}>> $GITHUB_ENV echo "AGENT_VERSION= ${formatTime}>> $GITHUB_ENV
cp ./agent-*.jar ./octopus-agent-${formatTime}.jar cp ./agent-*.jar ./octopus-agent-${formatTime}.jar
cp ./agent-*.jar ./octopus-agent-${{ env.AGENT_VERSION }}.jar
cd /home/runner/work/ProjectOctopus/ProjectOctopus cd /home/runner/work/ProjectOctopus/ProjectOctopus
echo "--------------------------------------" echo "--------------------------------------"