From c9e5e38a4c532b7a76a8b7db8f93a319267647e2 Mon Sep 17 00:00:00 2001 From: kweijack Date: Sat, 14 Oct 2023 02:28:34 +0000 Subject: [PATCH] ops: github release workflow --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 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..30968d5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + tags: + - "v*.*.*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pre-build image and build release in devcontainer + uses: devcontainers/ci@v0.3 + env: + # To fix ${localEnv:XAUTHORITY} mount error + XAUTHORITY: /tmp + with: + imageName: ghcr.io/dev6699/rspy-devcontainer + cacheFrom: ghcr.io/dev6699/rspy-devcontainer + push: always + runCmd: go build -o rspy main.go + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + rspy