Skip to content

Commit

Permalink
Issue #41 try to diagnose release push asset that dont work
Browse files Browse the repository at this point in the history
  • Loading branch information
boly38 committed Nov 28, 2024
1 parent 0c4fdc6 commit 0f7ce9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/publish_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
env:
REPO_WEB_URL: https://github.com/chickarmy/chickenbot-web
REPO_API_URL: https://api.github.com/repos/chickarmy/chickenbot-web
FILE_NAME: package.readme.txt
FILE_NAME: mySampleTestFile-1.2.3.exe
SKIP_PUSH_VERSION_WORKFLOW: true
SKIP_PUBLISH: true

steps:
Expand All @@ -34,12 +35,13 @@ jobs:
run: |
# Extract the version from package.json and store it as an environment variable
version=$(jq -r '.version' package.json)
echo "VERSION=$version" >> $GITHUB_ENV
expectedVersion="v$version-test"
echo "Package version is $version"
if [[ "${{ github.ref_name }}" != "v$version" ]]; then
echo "Error: Tag ${{ github.ref_name }} does not match version v$version"
if [[ "${{ github.ref_name }}" != "$expectedVersion" ]]; then
echo "Error: Tag ${{ github.ref_name }} does not match version ${expectedVersion}"
exit 1
fi
echo "VERSION=$version" >> $GITHUB_ENV
# https://github.com/mikefarah/yq?tab=readme-ov-file#github-action
- name: Install yq
Expand Down Expand Up @@ -77,12 +79,13 @@ jobs:
- name: 1) Prepare release file (Simulation)
run: |
echo 'this is sample publish from another repo' > $FILE_NAME
mkdir -p ./packages
mv $FILE_NAME ./packages/
echo "Preparing file for release"
mkdir -p ./packages
head -c 20M </dev/urandom >./packages/$FILE_NAME
echo "Preparing release file ./packages/$FILE_NAME done :"
ls -lartkh ./packages/
- name: 2) push new release definition to another repo
if: ${{ env.SKIP_PUSH_VERSION_WORKFLOW != 'true' }}
run: |
# Disable -e temporarily to capture the curl exit status manually
set +e
Expand Down Expand Up @@ -115,6 +118,7 @@ jobs:
echo "$response"
- name: 3) Waiting for push-new-version workflow completion
if: ${{ env.SKIP_PUSH_VERSION_WORKFLOW != 'true' }}
id: wait_for_completion
run: |
# Wait and check the status of the triggered workflow
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sandbox-fake-app",
"version": "0.0.001",
"version": "0.0.002",
"type": "module",
"description": "a sandbox repo to play with GHA",
"private": false,
Expand Down
21 changes: 5 additions & 16 deletions versions.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: MonProjet
versions:
- version: 0.0.002
label: test release 0.0.002
label_fr: test publication 0.0.002
description: test 72 release and assets
description_fr: test 72 release et assets
- version: 0.0.001
label: test release 0.0.001
label_fr: test publication 0.0.001
Expand All @@ -12,19 +17,3 @@ versions:
Ceci les amis
est un test de publication
d'une fausse version de test
- version: 1.0.0
label: release 1.0.0
label_fr: publication 1.0.0
description: This is the TEST description
description_fr: |
Première FAKE version officielle du projet.
Inclut les fonctionnalités de base et la documentation initiale.
- version: 1.0.1
label: release 1.0.&
label_fr: publication 1.0.1
description: This is the TESTBis description
description_fr: |
Seconde FAKE version du projet.
Inclut des fonctionnalités de plus.

0 comments on commit 0f7ce9b

Please sign in to comment.