From 6f0780645ac68f16bdd5215c453afefe3362e111 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:11:57 +0200 Subject: [PATCH 01/19] new --- .github/workflows/create-artefacts.yml | 11 +++++++---- .github/workflows/release.yml | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index bcd76f2..3d1c983 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -2,6 +2,9 @@ name: Create Artefacts on: [pull_request] +env: + tag: v1.2.9 + jobs: create-artefacts: runs-on: ubuntu-latest @@ -9,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - - run: echo ${{github.sha}} > path/to/artifact/world.txt + - run: echo $tag > path/to/artifact/artefact-$tag.txt - uses: actions/upload-artifact@v3 with: - name: my-artifact + name: my-artifact-$tag path: path/to/artifact/world.txt test-artefact: @@ -22,7 +25,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - name: my-artifact + name: my-artifact-$tag path: path/to/artifact - name: Display structure of downloaded files @@ -30,5 +33,5 @@ jobs: working-directory: path/to/artifact - name: Show text artefact - run: cat world.txt + run: cat artefact-$tag.txt working-directory: path/to/artifact diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c14a416..9ceeaa5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,8 @@ on: push: branches: - main +env: + tag: v1.2.9 jobs: release: @@ -24,7 +26,7 @@ jobs: - run: mkdir -p dist - run: echo $ART_VERSION - name: Download artefacts - run: gh run download -n my-artifact + run: gh run download -n my-artifact-$tag working-directory: dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -42,9 +44,8 @@ jobs: - name: Release by softprops uses: softprops/action-gh-release@v1 with: - files: ./dist/world.txt - tag_name: v1.2.9 - + files: ./dist/* + tag_name: $tag # - name: Release # run: gh release create v1.2.3 ./dist/* From d90e580668bd55f8c39279dc7e1e102277c26a3e Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:19:10 +0200 Subject: [PATCH 02/19] asd --- .github/workflows/create-artefacts.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 3d1c983..d9d4ee5 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -9,13 +9,15 @@ jobs: create-artefacts: runs-on: ubuntu-latest name: Create artefact + env: + tag: v1.2.9 steps: - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - - run: echo $tag > path/to/artifact/artefact-$tag.txt + - run: echo $tag > path/to/artifact/artefact-${tag}.txt - uses: actions/upload-artifact@v3 with: - name: my-artifact-$tag + name: my-artifact-${{tag}} path: path/to/artifact/world.txt test-artefact: From bee1cd93f5e6e2d30ee58fc8653993b007660046 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:19:55 +0200 Subject: [PATCH 03/19] asd --- .github/workflows/create-artefacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index d9d4ee5..a347c70 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -15,6 +15,7 @@ jobs: - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - run: echo $tag > path/to/artifact/artefact-${tag}.txt + - run: ls -al path/to/artifact - uses: actions/upload-artifact@v3 with: name: my-artifact-${{tag}} From 7a4e08a60680ff61fe123df57f61c1f182276c76 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:20:31 +0200 Subject: [PATCH 04/19] asdasd --- .github/workflows/create-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index a347c70..ec9aa2b 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -18,7 +18,7 @@ jobs: - run: ls -al path/to/artifact - uses: actions/upload-artifact@v3 with: - name: my-artifact-${{tag}} + name: my-artifact-${tag} path: path/to/artifact/world.txt test-artefact: From 264d02cd4653c84230d9cc63960309881f192a4b Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:21:30 +0200 Subject: [PATCH 05/19] asdasd --- .github/workflows/create-artefacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index ec9aa2b..e5fd1cf 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - name: my-artifact-$tag + name: my-artifact-${tag} path: path/to/artifact - name: Display structure of downloaded files @@ -36,5 +36,5 @@ jobs: working-directory: path/to/artifact - name: Show text artefact - run: cat artefact-$tag.txt + run: cat artefact-${tag}.txt working-directory: path/to/artifact From a1c195d8995ffa3c1413298b06c9fbc05b133ff3 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:22:42 +0200 Subject: [PATCH 06/19] asd --- .github/workflows/create-artefacts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index e5fd1cf..adc496b 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -25,6 +25,8 @@ jobs: name: Test artefacts runs-on: ubuntu-latest needs: [create-artefacts] + env: + tag: v1.2.9 steps: - uses: actions/download-artifact@v3 with: From 62cf7f323e06ea6479083fb103a118ea02d572f5 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:23:43 +0200 Subject: [PATCH 07/19] asd --- .github/workflows/create-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index adc496b..93960e6 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: my-artifact-${tag} - path: path/to/artifact/world.txt + path: path/to/artifact/artefact-${tag}.txt test-artefact: name: Test artefacts From 139ef1f5ba1d80ad9f5c776444610256ff7d4d48 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:27:12 +0200 Subject: [PATCH 08/19] asdad --- .github/workflows/create-artefacts.yml | 20 ++++++++++---------- .github/workflows/release.yml | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 93960e6..6cd6f37 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -1,4 +1,4 @@ -name: Create Artefacts +name: Create artifacts on: [pull_request] @@ -6,25 +6,25 @@ env: tag: v1.2.9 jobs: - create-artefacts: + create-artifacts: runs-on: ubuntu-latest - name: Create artefact + name: Create artifact env: tag: v1.2.9 steps: - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - - run: echo $tag > path/to/artifact/artefact-${tag}.txt + - run: echo $tag > path/to/artifact/artifact-${tag}.txt - run: ls -al path/to/artifact - uses: actions/upload-artifact@v3 with: name: my-artifact-${tag} - path: path/to/artifact/artefact-${tag}.txt + path: path/to/artifact/artifact-${{tag}}.txt - test-artefact: - name: Test artefacts + test-artifact: + name: Test artifacts runs-on: ubuntu-latest - needs: [create-artefacts] + needs: [create-artifacts] env: tag: v1.2.9 steps: @@ -37,6 +37,6 @@ jobs: run: ls -R working-directory: path/to/artifact - - name: Show text artefact - run: cat artefact-${tag}.txt + - name: Show text artifact + run: cat artifact-${tag}.txt working-directory: path/to/artifact diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ceeaa5..ccc2c94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: tag: v1.2.9 steps: - uses: actions/checkout@v3 - # Do not have access to other WF artefacts + # Do not have access to other WF artifacts # - uses: actions/download-artifact@v3 # with: # name: my-artifact @@ -25,7 +25,7 @@ jobs: # working-directory: dist - run: mkdir -p dist - run: echo $ART_VERSION - - name: Download artefacts + - name: Download artifacts run: gh run download -n my-artifact-$tag working-directory: dist env: From 26739931798f446573ca6332ab094e5d0ac4f176 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 08:28:08 +0200 Subject: [PATCH 09/19] asdasda --- .github/workflows/create-artefacts.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 6cd6f37..19e9d6a 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -1,9 +1,6 @@ name: Create artifacts -on: [pull_request] - -env: - tag: v1.2.9 +on: [pull_request, push] jobs: create-artifacts: @@ -19,7 +16,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: my-artifact-${tag} - path: path/to/artifact/artifact-${{tag}}.txt + path: path/to/artifact/artifact-${tag}.txt test-artifact: name: Test artifacts From 75cbd90be78c2448830413b64ef96791153b3220 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 11:23:59 +0200 Subject: [PATCH 10/19] asd --- .github/workflows/create-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 19e9d6a..4605dd6 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - name: my-artifact-${tag} + name: my-artifact-${{tag}} path: path/to/artifact - name: Display structure of downloaded files From 4177c43115504f2cc3829e940389639a1f2d4c9d Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 11:39:13 +0200 Subject: [PATCH 11/19] asasd --- .github/workflows/create-artefacts.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 4605dd6..da8d947 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -11,11 +11,12 @@ jobs: steps: - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - - run: echo $tag > path/to/artifact/artifact-${tag}.txt + - run: echo $tag > path/to/artifact/artifact-$tag.txt - run: ls -al path/to/artifact - uses: actions/upload-artifact@v3 with: - name: my-artifact-${tag} + name: my-artifact-${{env.tag}} + # name: ${{ env.folder_name }}-${{ github.sha }} path: path/to/artifact/artifact-${tag}.txt test-artifact: @@ -27,7 +28,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - name: my-artifact-${{tag}} + name: my-artifact-${{env.tag}} path: path/to/artifact - name: Display structure of downloaded files From 809842c691c99f77b5a01ea0d60a5745db9e0e7c Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 11:40:55 +0200 Subject: [PATCH 12/19] asd --- .github/workflows/create-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index da8d947..897f84e 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -17,7 +17,7 @@ jobs: with: name: my-artifact-${{env.tag}} # name: ${{ env.folder_name }}-${{ github.sha }} - path: path/to/artifact/artifact-${tag}.txt + path: path/to/artifact/artifact-${{env.tag}}.txt test-artifact: name: Test artifacts From 79a3c115a920326b189a8823916ce5e164d76392 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 12:01:57 +0200 Subject: [PATCH 13/19] asdasd --- .github/workflows/create-artefacts.yml | 17 +++++++++++++++-- package.json | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 package.json diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 897f84e..8f36b52 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -2,13 +2,27 @@ name: Create artifacts on: [pull_request, push] +env: + tag: v1.2.9 + jobs: + + get-package-version: + name: Get package version + runs-on: ubuntu-latest + steps: + - name: Get version + run: | + export PACKAGE_VERSION=`node -p "require('./package.json').version"`; + create-artifacts: runs-on: ubuntu-latest name: Create artifact + needs: [get-package-version] env: - tag: v1.2.9 + tag: $PACKAGE_VERSION steps: + - run: echo $tag - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - run: echo $tag > path/to/artifact/artifact-$tag.txt @@ -16,7 +30,6 @@ jobs: - uses: actions/upload-artifact@v3 with: name: my-artifact-${{env.tag}} - # name: ${{ env.folder_name }}-${{ github.sha }} path: path/to/artifact/artifact-${{env.tag}}.txt test-artifact: diff --git a/package.json b/package.json new file mode 100644 index 0000000..db4fb1c --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "github-action-tests", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/BSekula/github-actions-test.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/BSekula/github-actions-test/issues" + }, + "homepage": "https://github.com/BSekula/github-actions-test#readme" +} From 03c70518b7cc34e039827f0b07518406a1acdaa1 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 12:48:18 +0200 Subject: [PATCH 14/19] asd --- .github/workflows/create-artefacts.yml | 24 +++++++++++------------- .github/workflows/release.yml | 6 +++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 8f36b52..97aa51c 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -2,35 +2,33 @@ name: Create artifacts on: [pull_request, push] -env: - tag: v1.2.9 - jobs: - get-package-version: - name: Get package version - runs-on: ubuntu-latest - steps: - - name: Get version - run: | - export PACKAGE_VERSION=`node -p "require('./package.json').version"`; + # get-package-version: + # name: Get package version + # runs-on: ubuntu-latest + # steps: + # - name: Get version + # run: | + # export PACKAGE_VERSION=`node -p "require('./package.json').version"`; create-artifacts: runs-on: ubuntu-latest name: Create artifact needs: [get-package-version] env: - tag: $PACKAGE_VERSION + tag: v3.0.0 steps: - run: echo $tag - uses: actions/checkout@v3 - run: mkdir -p path/to/artifact - - run: echo $tag > path/to/artifact/artifact-$tag.txt + - run: echo $tag > path/to/artifact/artifact1-$tag.txt + - run: echo $tag > path/to/artifact/artifact2-$tag.txt - run: ls -al path/to/artifact - uses: actions/upload-artifact@v3 with: name: my-artifact-${{env.tag}} - path: path/to/artifact/artifact-${{env.tag}}.txt + path: path/to/artifact/* test-artifact: name: Test artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ccc2c94..81401d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,14 +5,14 @@ on: branches: - main env: - tag: v1.2.9 + tag: v3.0.0 jobs: release: name: Release runs-on: ubuntu-latest env: - tag: v1.2.9 + tag: v3.0.0 steps: - uses: actions/checkout@v3 # Do not have access to other WF artifacts @@ -26,7 +26,7 @@ jobs: - run: mkdir -p dist - run: echo $ART_VERSION - name: Download artifacts - run: gh run download -n my-artifact-$tag + run: gh run download -n my-artifact-${{env.tag}} working-directory: dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 41fe37df5b26559348754353a850668030eb02d0 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 12:49:32 +0200 Subject: [PATCH 15/19] asd --- .github/workflows/create-artefacts.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 97aa51c..18100a2 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -3,7 +3,6 @@ name: Create artifacts on: [pull_request, push] jobs: - # get-package-version: # name: Get package version # runs-on: ubuntu-latest @@ -28,7 +27,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: my-artifact-${{env.tag}} - path: path/to/artifact/* + path: path/to/artifact/ test-artifact: name: Test artifacts From 76b6711220e3d8d9c19e12120954561276099827 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 12:50:02 +0200 Subject: [PATCH 16/19] asd --- .github/workflows/create-artefacts.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 18100a2..849643a 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -3,14 +3,6 @@ name: Create artifacts on: [pull_request, push] jobs: - # get-package-version: - # name: Get package version - # runs-on: ubuntu-latest - # steps: - # - name: Get version - # run: | - # export PACKAGE_VERSION=`node -p "require('./package.json').version"`; - create-artifacts: runs-on: ubuntu-latest name: Create artifact From 76d8baf09ef155da703240466ea06fef438d8381 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 12:50:54 +0200 Subject: [PATCH 17/19] asd --- .github/workflows/create-artefacts.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 849643a..87c7313 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -6,7 +6,6 @@ jobs: create-artifacts: runs-on: ubuntu-latest name: Create artifact - needs: [get-package-version] env: tag: v3.0.0 steps: From 14eddf7d42a16c76fa00dd3948158acf09cb51bb Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 13:29:06 +0200 Subject: [PATCH 18/19] asd --- .github/workflows/create-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index 87c7313..f0ba52a 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest needs: [create-artifacts] env: - tag: v1.2.9 + tag: v3.0.0 steps: - uses: actions/download-artifact@v3 with: From 368d05c39348c1d65c2e437d4b7b0ef76230bc03 Mon Sep 17 00:00:00 2001 From: Bartosz Sekula Date: Wed, 23 Aug 2023 13:30:58 +0200 Subject: [PATCH 19/19] asd --- .github/workflows/create-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-artefacts.yml b/.github/workflows/create-artefacts.yml index f0ba52a..425b3a1 100644 --- a/.github/workflows/create-artefacts.yml +++ b/.github/workflows/create-artefacts.yml @@ -37,5 +37,5 @@ jobs: working-directory: path/to/artifact - name: Show text artifact - run: cat artifact-${tag}.txt + run: cat artifact1-${{env.tag}}.txt working-directory: path/to/artifact