Update go.mod #10
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: Push Build | |
on: push | |
jobs: | |
build: | |
name: ${{matrix.config.name}} | |
runs-on: ${{matrix.config.os}} | |
strategy: | |
matrix: | |
config: | |
- { | |
name: "Linux Build & Test", | |
os: ubuntu-latest | |
} | |
- { | |
name: "Microsoft Windows Build & Test", | |
os: windows-latest | |
} | |
- { | |
name: "MacOs Build & Test", | |
os: macos-latest | |
} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Go build | |
run: | | |
go mod tidy | |
go build | |
- name: Zip file Unix | |
if: matrix.config.os != 'windows-latest' | |
run: | | |
zip -r ./wakarizer_${{matrix.config.os}}.zip ./wakarizer | |
- name: Zip file Windows | |
if: matrix.config.os == 'windows-latest' | |
run: | | |
tar -cf ./wakarizer_${{matrix.config.os}}.zip ./wakarizer.exe | |
- uses: "actions/upload-artifact@v2" | |
id: upload_artifact | |
with: | |
path: ./wakarizer_${{matrix.config.os}}.zip | |
name: wakarizer_${{matrix.config.os}}.zip | |
release: | |
if: contains(github.ref, 'tags/v') | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1.0.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Store Release url | |
run: | | |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url | |
- uses: actions/upload-artifact@v1 | |
with: | |
path: ./upload_url | |
name: upload_url | |
publish: | |
needs: release | |
if: contains(github.ref, 'tags/v') | |
name: ${{ matrix.config.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: | |
- { | |
name: "Linux Release", | |
os: ubuntu-latest | |
} | |
- { | |
name: "Microsoft Windows Release", | |
os: windows-latest | |
} | |
- { | |
name: "MacOs Release", | |
os: macos-latest | |
} | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: wakarizer_${{matrix.config.os}}.zip | |
path: ./ | |
- name: Download URL | |
uses: actions/download-artifact@v1 | |
with: | |
name: upload_url | |
path: ./ | |
- name: Set Upload URL | |
id: set_upload_url | |
run: | | |
upload_url=`cat ./upload_url` | |
echo ::set-output name=upload_url::$upload_url | |
- name: Upload to Release | |
id: upload_to_release | |
uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.set_upload_url.outputs.upload_url }} | |
asset_path: ./wakarizer_${{matrix.config.os}}.zip | |
asset_name: wakarizer_${{matrix.config.os}}.zip | |
asset_content_type: application/zip |