diff --git a/.github/.gitkeep b/.github/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..ae05888 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,41 @@ +name: CD + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.17' + + - name: Get version + id: get_version + run: | + echo "VERSION=$(grep 'const Version' version/version.go | awk -F\" '{print $2}')" >> $GITHUB_ENV + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload release asset + uses: softprops/action-gh-release@v1 + with: + files: dg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}