From a173ca105bc3b5704f4b75d851d8a23fca00d315 Mon Sep 17 00:00:00 2001 From: picopock <95534779+picopock@users.noreply.github.com> Date: Sat, 22 Apr 2023 23:08:19 +0800 Subject: [PATCH] ci(workflow): add release workflow (#2) --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f4fc001 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: release + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get Version + id: get_version + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + + - name: Package files + run: | + mkdir mosdns-config-${{ steps.get_version.outputs.VERSION }} + tar -zcvf mosdns-config-${{ steps.get_version.outputs.VERSION }}.tar.gz ./mosdnsv4 ./mosdnsv5 ./README.md + zip -r mosdns-config-${{ steps.get_version.outputs.VERSION }}.zip ./mosdnsv4 ./mosdnsv5 ./README.md + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./mosdns-config-* + draft: false