Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go App Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.19 | |
- name: Get Dependencies | |
working-directory: ./ | |
run: go mod tidy | |
- name: Run Build | |
working-directory: ./ | |
run: | | |
echo "Create output dir" | |
mkdir -p ./out/ | |
echo "Building Linux amd64 binary" | |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./out/ddosify-latencies-linux-amd64 | |
echo "Building Linux arm64 binary" | |
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ./out/ddosify-latencies-linux-arm64 | |
echo "Building Darwin amd64 binary" | |
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./out/ddosify-latencies-darwin-amd64 | |
echo "Building Darwin arm64 binary" | |
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ./out/ddosify-latencies-darwin-arm64 | |
echo "Building Windows amd64 binary" | |
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./out/ddosify-latencies-windows-amd64.exe | |
- name: Save CLI Binaries Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ddosify-latencies-binaries | |
path: ./out/ | |
release: | |
name: Creates a new release with the resulting binaries | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
- asset_name: ddosify-latencies-linux-amd64 | |
- asset_name: ddosify-latencies-linux-arm64 | |
- asset_name: ddosify-latencies-darwin-amd64 | |
- asset_name: ddosify-latencies-darwin-arm64 | |
- asset_name: ddosify-latencies-windows-amd64.exe | |
steps: | |
- name: Pull the cli binaries from Artifacts | |
uses: actions/[email protected] | |
with: | |
path: /tmp/ | |
- name: Upload binary to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: /tmp/ddosify-latencies-binaries/${{ matrix.asset_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }}-release | |
overwrite: true | |
body: "Automatic release created by a GitHub Action" |