trying new workflow #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: Release | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
BuildAndRelease: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Tag | |
id: tag | |
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token | |
WITH_V: false | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Install Prerequisites | |
run: | | |
sudo apt-get install libpcap-dev | |
- name: Build | |
run: CGO_ENABLED=1 go build -o sherlock -v ./... | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sherlock | |
path: sherlock | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: "${{ steps.tag.outputs.new_tag }}" | |
release_name: Release ${{ steps.tag.outputs.new_tag }} | |
draft: false | |
prerelease: false |