From 0d0e206003c15b9bdb33b5be45122fbdf7dfafd1 Mon Sep 17 00:00:00 2001 From: Jeremy Cook Date: Mon, 16 Dec 2024 13:14:39 +1300 Subject: [PATCH] Create release.yml --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 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..5ba1955 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Build + +on: + push: + tags: + - '*.*.*' + pull_request: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Package + run: | + echo packaging... + tar -czf release-${{ env.RELEASE_VERSION }}.tar.gz docker-compose.yaml vols + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: release-${{ env.RELEASE_VERSION }} + path: release-${{ env.RELEASE_VERSION }}.tar.gz + + - name: Make Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + name: release-${{ env.RELEASE_VERSION }} + files: | + release-${{ env.RELEASE_VERSION }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}