diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a9cedbb..d732e0b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,25 +1,37 @@ # .github/workflows/release.yaml +name: release + +# on events on: release: - types: [created] + types: + - created +# jobs jobs: - releases-matrix: - name: Release Go Binary + # generate build cross-platform build files + generate: + name: Generate cross-platform builds runs-on: ubuntu-latest - strategy: - matrix: - goos: [linux] - goarch: [amd64, arm64] steps: - - uses: actions/checkout@v3 - - uses: wangyoucao577/go-release-action@v1.30 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - goversion: "https://dl.google.com/go/go1.18.1.linux-amd64.tar.gz" - project_path: "." - binary_name: "discord-bot" - extra_files: README.md \ No newline at end of file + # step 1: checkout repository code + - name: Checkout the repository + uses: actions/checkout@v2 + + # step 2: generate build files + - name: Generate build files + uses: thatisuday/go-build-action@v1 + with: + platforms: "linux/amd64, linux/arm64, windows/amd64" + name: "discord-bot" + compress: "true" + dest: "dist" + + # step 3: upload build-artifacts + - name: Upload build-artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: "./dist/*.tar.gz"