Skip to content

Commit

Permalink
chore<ci>: auto-release script
Browse files Browse the repository at this point in the history
  • Loading branch information
vmfunc committed Oct 12, 2024
1 parent e38e486 commit f7ee343
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release

on:
push:
branches: [main]

jobs:
test:
uses: ./.github/workflows/runtest.yml

build-and-release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23"

- name: Build for Windows
run: GOOS=windows GOARCH=amd64 go build -o sif-windows-amd64.exe ./cmd/sif

- name: Build for macOS
run: GOOS=darwin GOARCH=amd64 go build -o sif-macos-amd64 ./cmd/sif

- name: Build for Linux
run: GOOS=linux GOARCH=amd64 go build -o sif-linux-amd64 ./cmd/sif

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false

- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sif-windows-amd64.exe
asset_name: sif-windows-amd64.exe
asset_content_type: application/octet-stream

- name: Upload macOS Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sif-macos-amd64
asset_name: sif-macos-amd64
asset_content_type: application/octet-stream

- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sif-linux-amd64
asset_name: sif-linux-amd64
asset_content_type: application/octet-stream
2 changes: 1 addition & 1 deletion .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: make
- name: Run Sif with features
run: |
./sif -u https://google.com -dnslist small -dirlist small -ports common -dork -git -whois -cms
./sif -u https://google.com -dnslist small -dirlist small -dork -git -whois -cms
if [ $? -eq 0 ]; then
echo "Sif ran successfully"
else
Expand Down

0 comments on commit f7ee343

Please sign in to comment.