Alterix 1.4.3: Enhanced Query Generation #96
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 Deploy | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.go' | |
- '!tools/**/*' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**/*.go' | |
- '!tools/**/*' | |
release: | |
types: | |
- created | |
jobs: | |
build-and-deploy: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
go-version: | |
- 1.19 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build for ${{ matrix.platform }} | |
run: | | |
go build -o alterix | |
go build -o add_query ./tools/api/add_query | |
go build -o add_rule ./tools/api/add_rule | |
- name: Test | |
run: echo "No tests to run." | |
- name: Create Zip Archive (Windows) | |
if: ${{ matrix.platform == 'windows-latest' }} | |
run: | | |
Rename-Item -Path ./alterix -NewName "alterix.exe" | |
Rename-Item -Path ./add_query -NewName "add_query.exe" | |
Rename-Item -Path ./add_rule -NewName "add_rule.exe" | |
powershell Compress-Archive -Path ./alterix.exe, ./add_query.exe, ./add_rule.exe -DestinationPath alterix-${{ matrix.platform }}.zip | |
- name: Create Zip Archive (Linux, macOS) | |
if: ${{ matrix.platform != 'windows-latest' }} | |
run: | | |
zip -r alterix-${{ matrix.platform }}.zip alterix add_query add_rule | |
- name: Upload Assets | |
if: ${{ github.event_name == 'release' }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./alterix-${{ matrix.platform }}.zip | |
asset_name: alterix-${{ matrix.platform }}.zip | |
asset_content_type: application/octet-stream |