new build chenages #10
Workflow file for this run
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: Build and publish xk6-mongo | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build xk6-mongo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Go π§βπ» | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: Install xk6 and build xk6-mongo for different platforms ποΈ | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
mkdir dist | |
go install go.k6.io/xk6/cmd/xk6@latest | |
# ------------------------- Linux amd64 ------------------------- | |
GOOS=linux GOARCH=amd64 xk6 build --output dist/xk6-mongo_${{ github.ref_name }}_linux_amd64 --with github.com/GhMartingit/xk6-mongo@${{ github.ref_name }} | |
tar cvzf dist/xk6-mongo_${{ github.ref_name }}_linux_amd64.tar.gz dist/xk6-mongo_${{ github.ref_name }}_linux_amd64 | |
# ------------------------- Linux arm64 ------------------------- | |
GOOS=linux GOARCH=arm64 xk6 build --output dist/xk6-mongo_${{ github.ref_name }}_linux_arm64 --with github.com/GhMartingit/xk6-mongo@${{ github.ref_name }} | |
tar cvzf dist/xk6-mongo_${{ github.ref_name }}_linux_arm64.tar.gz dist/xk6-mongo_${{ github.ref_name }}_linux_arm64 | |
# ------------------------- macOS amd64 ------------------------- | |
GOOS=darwin GOARCH=amd64 xk6 build --output dist/xk6-mongo_${{ github.ref_name }}_darwin_amd64 --with github.com/GhMartingit/xk6-mongo@${{ github.ref_name }} | |
tar cvzf dist/xk6-mongo_${{ github.ref_name }}_darwin_amd64.tar.gz dist/xk6-mongo_${{ github.ref_name }}_darwin_amd64 | |
# ------------------------- macOS arm64 ------------------------- | |
GOOS=darwin GOARCH=arm64 xk6 build --output dist/xk6-mongo_${{ github.ref_name }}_darwin_arm64 --with github.com/GhMartingit/xk6-mongo@${{ github.ref_name }} | |
tar cvzf dist/xk6-mongo_${{ github.ref_name }}_darwin_arm64.tar.gz dist/xk6-mongo_${{ github.ref_name }}_darwin_arm64 | |
# ------------------------- Windows amd64 ------------------------- | |
GOOS=windows GOARCH=amd64 xk6 build --output dist/xk6-mongo_${{ github.ref_name }}_windows_amd64.exe --with github.com/GhMartingit/xk6-mongo@${{ github.ref_name }} | |
tar cvzf dist/xk6-mongo_${{ github.ref_name }}_windows_amd64.tar.gz dist/xk6-mongo_${{ github.ref_name }}_windows_amd64.exe | |
# ------------------------- Windows arm64 ------------------------- | |
GOOS=windows GOARCH=arm64 xk6 build --output dist/xk6-mongo_${{ github.ref_name }}_windows_arm64.exe --with github.com/GhMartingit/xk6-mongo@${{ github.ref_name }} | |
tar cvzf dist/xk6-mongo_${{ github.ref_name }}_windows_arm64.tar.gz dist/xk6-mongo_${{ github.ref_name }}_windows_arm64.exe | |
- name: Generate CycloneDX SBOM artifacts π | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest | |
cyclonedx-gomod mod -json -licenses -output code-cyclonedx-xk6-mongo-${{ github.ref_name }}.json | |
- name: Create Release π¦ and add binaries and SBOM files πΎ | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/*.tar.gz | |
code-cyclonedx-xk6-kafka-${{ github.ref_name }}.json | |
docker-image-cyclonedx-xk6-kafka-${{ github.ref_name }}.json |