Skip to content

Commit 2ddf10e

Browse files
authored
Merge pull request #10 from openzim/gh_action_release
2 parents 75e3687 + 383d6bb commit 2ddf10e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: On-Release
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
create-archive:
12+
name: create-archive
13+
needs: ['create-release']
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
format: [zip, tar.gz]
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Create archive
21+
shell: bash
22+
env:
23+
format: ${{ matrix.format }}
24+
run: |
25+
archive_name="zim-testing-suite-${{ github.ref_name }}"
26+
git archive --prefix="${archive_name}/" --output ${archive_name}.${{ env.format }} ${{ github.ref_name }}:data/
27+
28+
- name: Upload archive
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
format: ${{ matrix.format }}
32+
run: |
33+
archive="zim-testing-suite-${{ github.ref_name }}.${{ env.format }}"
34+
gh release upload "${{ github.ref_name }}" $archive

0 commit comments

Comments
 (0)