|
| 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. |
1 | 4 | name: Create GitHub release (examples repo) |
2 | 5 |
|
3 | 6 | on: |
|
6 | 9 | - v* |
7 | 10 |
|
8 | 11 | 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 | +
|
9 | 40 | create_release: |
| 41 | + needs: [ compute_environment_variables, build_examples ] |
10 | 42 | runs-on: ubuntu-24.04 |
11 | 43 | permissions: |
12 | 44 | contents: write # create the GH release |
13 | 45 | steps: |
14 | 46 | - name: Set env |
15 | 47 | run: | |
16 | | - echo "RELEASE_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV |
| 48 | + echo "RELEASE_VERSION=${{ needs.compute_environment_variables.outputs.version }}" >> $GITHUB_ENV |
17 | 49 | 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 | +
|
18 | 62 | - name: Create release |
19 | 63 | uses: ncipollo/release-action@v1 |
20 | 64 | with: |
|
24 | 68 | draft: true # Generate here in draft to not mess with the release-drafter workflow, this is not required in the targeted repository |
25 | 69 | generateReleaseNotes: true |
26 | 70 | name: ${{ env.RELEASE_VERSION }} |
| 71 | + artifacts: | |
| 72 | + maxgraph_${{ env.VERSION }}_examples.zip |
0 commit comments