Skip to content

Commit bae0552

Browse files
committed
workflow: Make zip for each release
1 parent a66325a commit bae0552

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

.github/workflows/release.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
Test:
12+
name: Make zip package
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Zip plugin package
18+
run: make package
19+
20+
- name: Upload release asset
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
ASSET_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip
24+
run: |
25+
gh api --method POST \
26+
-H "Accept: application/vnd.github+json" \
27+
-H "X-GitHub-Api-Version: 2022-11-28" \
28+
https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${{ env.ASSET_NAME }} \
29+
-f file='@dist/artifact-HEAD.zip'

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PLUGIN_NAME = mojxml_plugin
1+
PACKAGE_NAME = mojxml_plugin
22

33
# Use this tag for packaging
44
VERSION = HEAD
@@ -16,15 +16,15 @@ init: ## Startup project
1616
poetry install
1717

1818
deploy: ## Deploy to QGIS
19-
rsync -av --delete ${PLUGIN_NAME} $(QGIS_USER)/python/plugins/
19+
rsync -av --delete ${PACKAGE_NAME} $(QGIS_USER)/python/plugins/
2020

2121
package: ## Build zip package
2222
mkdir -p dist
23-
git archive -o dist/${PLUGIN_NAME}-${VERSION}.zip ${VERSION} ${PLUGIN_NAME}
23+
git archive -o dist/artifact-${VERSION}.zip ${VERSION} ${PACKAGE_NAME}
2424

2525
update-deps: ## Update mojxml library
2626
pip download mojxml --no-dependencies
2727
wheel3 unpack mojxml-*-py3-none-any.whl
28-
rsync -r --delete mojxml-*/mojxml ${PLUGIN_NAME}/
28+
rsync -r --delete mojxml-*/mojxml ${PACKAGE_NAME}/
2929
rm -rf mojxml-*/
3030
rm -rf mojxml-*.whl

0 commit comments

Comments
 (0)