Skip to content

Commit

Permalink
Merge pull request #7 from BSekula/test6
Browse files Browse the repository at this point in the history
Test6
  • Loading branch information
BSekula authored Aug 23, 2023
2 parents 489059c + 368d05c commit 1201592
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/create-artefacts.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
name: Create Artefacts
name: Create artifacts

on: [pull_request]
on: [pull_request, push]

jobs:
create-artefacts:
create-artifacts:
runs-on: ubuntu-latest
name: Create artefact
name: Create artifact
env:
tag: v3.0.0
steps:
- run: echo $tag
- 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/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
path: path/to/artifact/world.txt
name: my-artifact-${{env.tag}}
path: path/to/artifact/

test-artefact:
name: Test artefacts
test-artifact:
name: Test artifacts
runs-on: ubuntu-latest
needs: [create-artefacts]
needs: [create-artifacts]
env:
tag: v3.0.0
steps:
- uses: actions/download-artifact@v3
with:
name: my-artifact
name: my-artifact-${{env.tag}}
path: path/to/artifact

- name: Display structure of downloaded files
run: ls -R
working-directory: path/to/artifact

- name: Show text artefact
run: cat world.txt
- name: Show text artifact
run: cat artifact1-${{env.tag}}.txt
working-directory: path/to/artifact
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ on:
push:
branches:
- main
env:
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 artefacts
# Do not have access to other WF artifacts
# - uses: actions/download-artifact@v3
# with:
# name: my-artifact
Expand All @@ -23,8 +25,8 @@ jobs:
# working-directory: dist
- run: mkdir -p dist
- run: echo $ART_VERSION
- name: Download artefacts
run: gh run download -n my-artifact
- name: Download artifacts
run: gh run download -n my-artifact-${{env.tag}}
working-directory: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -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/*
Expand Down
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 1201592

Please sign in to comment.