Skip to content

Commit dca8899

Browse files
authored
ci: attach assets when creating the GitHub release (#439)
This simulates what could be done in the bpmn-visualization-examples repository if we need to attach the examples to the GitHub release.
1 parent 827ada5 commit dca8899

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

.github/workflows/post-release-create-gh-release_Examples_repo.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This workflow includes attachments specific after a new version tag is pushed in the main repository.
2+
# On 2026-01-23, this is not something that exists in the actual examples repository, but it is prepared for future use.
3+
# This is also done to validate the implementation proposed in https://github.com/maxGraph/maxGraph/pull/996 which could serve as a model for other repositories.
14
name: Create GitHub release (examples repo)
25

36
on:
@@ -6,15 +9,56 @@ on:
69
- v*
710

811
jobs:
12+
compute_environment_variables:
13+
runs-on: ubuntu-24.04
14+
permissions: { }
15+
outputs:
16+
version: ${{ steps.set_version.outputs.version }}
17+
steps:
18+
- name: Set version
19+
id: set_version
20+
run: |
21+
VERSION=${GITHUB_REF_NAME#v}
22+
echo "version=$VERSION" >> $GITHUB_OUTPUT
23+
24+
build_examples:
25+
needs: compute_environment_variables
26+
runs-on: ubuntu-24.04
27+
permissions:
28+
contents: read
29+
steps:
30+
- name: Upload fake files to simulate built examples
31+
uses: actions/upload-artifact@v6
32+
with:
33+
name: 'maxgraph_${{ needs.compute_environment_variables.outputs.version }}_examples.zip'
34+
path: |
35+
DESCRIPTION
36+
LICENSE
37+
tsconfig.json
38+
39+
940
create_release:
41+
needs: [ compute_environment_variables, build_examples ]
1042
runs-on: ubuntu-24.04
1143
permissions:
1244
contents: write # create the GH release
1345
steps:
1446
- name: Set env
1547
run: |
16-
echo "RELEASE_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
48+
echo "RELEASE_VERSION=${{ needs.compute_environment_variables.outputs.version }}" >> $GITHUB_ENV
1749
echo "TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
50+
51+
- name: Download examples artifact
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: maxgraph_${{ env.VERSION }}_examples.zip
55+
path: artifacts/examples
56+
57+
- name: Create zip files for release
58+
run: |
59+
cd artifacts/examples
60+
zip -r ../../maxgraph_${{ env.VERSION }}_examples.zip .
61+
1862
- name: Create release
1963
uses: ncipollo/release-action@v1
2064
with:
@@ -24,3 +68,5 @@ jobs:
2468
draft: true # Generate here in draft to not mess with the release-drafter workflow, this is not required in the targeted repository
2569
generateReleaseNotes: true
2670
name: ${{ env.RELEASE_VERSION }}
71+
artifacts: |
72+
maxgraph_${{ env.VERSION }}_examples.zip

0 commit comments

Comments
 (0)