Skip to content

Commit dfcf0ef

Browse files
dev2 test
1 parent 5def774 commit dfcf0ef

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/development.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Deploy Dev to GitHub Packages
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67

78
jobs:
89
deploy-dev:
@@ -19,27 +20,29 @@ jobs:
1920
- name: Get Latest Tag
2021
id: get-latest-tag
2122
run: |
22-
# Busca por tags que seguem o padrão vX.Y.Z
23+
# Procura por tags que sigam o padrão vX.Y.Z
2324
latest_tag=$(git tag -l 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1)
2425
if [ -z "$latest_tag" ]; then
2526
latest_tag="v0.0.0"
2627
fi
2728
echo "Latest tag: $latest_tag"
2829
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
2930
30-
- name: Set Dev Version
31+
- name: Set Dev Version with Inverted Timestamp
3132
id: set-dev-version
3233
run: |
33-
# Remove o "v" do prefixo e adiciona o sufixo "-dev"
34+
# Remove o "v" do início da tag
3435
version_without_v="${LATEST_TAG#v}"
35-
dev_version="${version_without_v}-dev"
36+
# Gera o timestamp invertido com o formato AAAAMMDD_HHSSmm
37+
# Obs.: Usamos %H%S%M para que o valor de segundos e minutos fiquem invertidos em relação ao padrão (%H%M%S)
38+
timestamp=$(date +'%Y%m%d_%H%S%M')
39+
dev_version="${version_without_v}-dev_${timestamp}"
3640
echo "Dev version: $dev_version"
3741
echo "DEV_VERSION=$dev_version" >> $GITHUB_ENV
3842
3943
- name: Update POM Version
4044
run: |
4145
echo "Updating Maven POM version to ${{ env.DEV_VERSION }}"
42-
# Atualiza a versão do POM para a versão dev (sem o "v")
4346
mvn versions:set -DnewVersion=${{ env.DEV_VERSION }} -DgenerateBackupPoms=false
4447
4548
- name: Setup Java and Maven
@@ -68,7 +71,6 @@ jobs:
6871
</settings>
6972
EOF
7073
71-
7274
- name: Build and Deploy to GitHub Packages
7375
run: |
7476
mvn clean install --settings $HOME/.m2/settings.xml

0 commit comments

Comments
 (0)