From c25578a2c6cb5f8baa76b7d74b5f16a39c293fe4 Mon Sep 17 00:00:00 2001 From: Sd416 Date: Tue, 17 Dec 2024 21:57:39 +0530 Subject: [PATCH] Added release.yml --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 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..7d1dae2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release Go Binary + +on: + release: + types: [created] + +permissions: + contents: write + packages: write + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, windows, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm64 + goos: windows + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set Up Go + uses: actions/setup-go@v4 + with: + go-version: "1.23" + + - name: Build Go Binary + run: | + GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o file-encryptor-${{ matrix.goos }}-${{ matrix.goarch }} main.go + + - name: Upload Binaries + uses: softprops/action-gh-release@v1 + with: + files: | + file-encryptor-${{ matrix.goos }}-${{ matrix.goarch }} + LICENSE + README.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}