diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/package.yml new file mode 100644 index 0000000..baa7b01 --- /dev/null +++ b/.gitea/workflows/package.yml @@ -0,0 +1,30 @@ +name: Create Source Package +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Create source archive + run: | + VERSION=${GITHUB_REF#refs/tags/} + git archive --format=zip --prefix=${GITHUB_REPOSITORY##*/}-${VERSION}/ HEAD > ${GITHUB_REPOSITORY##*/}-${VERSION}-sources.zip + git archive --format=tar.gz --prefix=${GITHUB_REPOSITORY##*/}-${VERSION}/ HEAD > ${GITHUB_REPOSITORY##*/}-${VERSION}-sources.tar.gz + + - name: Upload to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./*-sources.* + asset_name: sources-package + asset_content_type: application/zip \ No newline at end of file