Compare commits

...

23 commits

Author SHA1 Message Date
988849cf85
b
Some checks failed
/ publish_password (push) Failing after 6m18s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 22:37:48 +02:00
76d3e38f1b
a
Some checks failed
/ publish_password (push) Failing after 6m21s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 22:35:18 +02:00
e1c21dd30b
j
Some checks failed
/ publish (push) Failing after 6m12s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:23:30 +02:00
27cb3d22e2
i
Some checks failed
/ publish (push) Failing after 6m29s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:21:14 +02:00
5d2482dd0e
h
Some checks failed
/ publish (push) Failing after 6m36s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:18:22 +02:00
c97b8bb435
g
Some checks failed
/ publish (push) Failing after 6m24s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:12:17 +02:00
5b2423e03f
g
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:11:47 +02:00
06ae277393
f
Some checks failed
/ publish (push) Failing after 6m37s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:02:38 +02:00
1fe7b44064
e
Some checks failed
/ publish (push) Failing after 6m37s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 17:00:18 +02:00
d462d4967b
d
Some checks failed
/ publish (push) Failing after 6m39s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 16:49:05 +02:00
659e401f02
c
Some checks failed
/ publish (push) Failing after 6m41s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 15:46:53 +02:00
5bfc54bad8
b
Some checks failed
/ publish (push) Failing after 6m34s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 15:39:40 +02:00
34d1d2813f
a
Some checks failed
/ publish (push) Failing after 6m43s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-12 15:36:56 +02:00
f369ef3260
j
Some checks failed
/ publish (push) Failing after 6m38s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 15:22:03 +02:00
d6075bad88
i
Some checks failed
/ publish (push) Failing after 6m11s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 15:14:10 +02:00
b05f5fa3d4
h
Some checks failed
/ publish (push) Failing after 6m13s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 15:12:19 +02:00
aca4ee8b1f
g
All checks were successful
/ publish (push) Successful in 6m33s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 15:09:33 +02:00
aad450e0c2
f
Some checks failed
/ publish (push) Failing after 6m34s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 14:52:52 +02:00
596df19371
e
All checks were successful
/ publish (push) Successful in 6m36s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 14:41:33 +02:00
de8b053ad4
d
Some checks failed
/ publish (push) Has been cancelled
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 14:38:31 +02:00
a3eef4dcbc
c
All checks were successful
/ test (pull_request) Successful in 6m18s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 14:17:37 +02:00
46d93082a4
b
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 14:17:20 +02:00
97753c5cd4
a
All checks were successful
/ publish (push) Successful in 6m34s
/ test (pull_request) Successful in 6m29s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-08-10 14:11:58 +02:00
4 changed files with 50 additions and 18 deletions

View file

@ -4,15 +4,23 @@ on:
push:
jobs:
publish:
publish_password:
runs-on: docker
steps:
- run: echo All good!
- run: apt-get update && apt-get install -y make
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- run: ls -la
- run: make build_password
- name: test secrets
run: echo "${PASSWORD}" && bash ./scripts/publish_packages.sh "./bin" "password"
env:
LOGIN: ${{ forge.ACTOR }}
PASSWORD: ${{ secrets.PACKAGE }}
SERVER_URL: ${{ forge.SERVER_URL }}
OWNER: ${{ forge.REPOSITORY_OWNER }}
VER: latest
- run: make publish_password
env:
VER: latest

View file

@ -1,9 +1,9 @@
on:
pull_request:
types: [opened, synchronize, closed]
types: [opened, closed]
jobs:
test:
validate_password:
runs-on: docker
steps:
- run: echo All good!

View file

@ -1,14 +1,11 @@
ARCH := amd64 arm64
OS := linux windows darwin
NAME := password
VERSION := $(shell git describe)
BUILD := $(shell git rev-parse HEAD)
AUTH_HEADER := Authorization: token ${GITHUB_TOKEN}
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
.PHONY: all build_password publish_password
.PHONY: all build
all: build
all: build_password publish_password
build_password:
$(foreach GOOS, ${OS},\
@ -17,10 +14,14 @@ build_password:
))
publish_password:
$(shell curl -vvv -H "${AUTH_HEADER}" -X DELETE ${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${NAME}/${VER})
$(foreach GOOS, ${OS}, \
$(foreach GOARCH, ${ARCH}, \
$(curl --silent --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${NAME}_${GOOS}_${GOARCH}.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${NAME}/${VER}/${NAME}_${GOOS}_${GOARCH}.tar.gz") \
))
$(echo "token: ${{ secrets.PACKAGES }}") \
$(info Uploading ${NAME}_${GOOS}_${GOARCH}.tar.gz) \
$(shell curl -vvv --user "nicolas.boufidjeline:${{ secrets.PACKAGES }}" --upload-file bin/${NAME}_${GOOS}_${GOARCH}.tar.gz ${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${NAME}/${VER}/${NAME}_${GOOS}_${GOARCH}.tar.gz) \
) \
)
clean:
rm -rf bin

View file

@ -0,0 +1,23 @@
#!/bin/bash
echo "Publish generique package"
PATH_DIR="${1}"
NAME="${2}"
USER="${LOGIN}"
TOKEN="${PASSWORD}"
echo "user -> ${USER}"
echo "token -> ${TOKEN}"
echo "server -> ${SERVER_URL}"
echo "owner -> ${OWNER}"
ls "${PATH_DIR}" | while read tmp
do
curl -vvv --user "${USER}:${TOKEN}" -X DELETE "${SERVER_URL}/api/packages/${OWNER}/generic/${NAME}/${VER}/${tmp}" && \
echo delete ok || \
echo delete not necessarie
curl -vvv --user "${USER}:${TOKEN}" --upload-file "${PATH_DIR}/${tmp}" "${SERVER_URL}/api/packages/${OWNER}/generic/${NAME}/${VER}/${tmp}" && \
echo upload ok || \
echo upload fail
done