chore: change repo structure #9
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 For All Specified OS Architecture | |
on: | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
push: | |
paths-ignore: | |
- 'README.md' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go Environment | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
check-latest: true | |
cache: true | |
- name: Os Build | |
run: | | |
echo "Adding Time to Github Env" | |
echo "RNAME=build $(date '+%Y-%m-%d %H:%M')" >> $GITHUB_ENV | |
echo "RTXT=### This release was automatically generated on $(date '+%A %Y/%m/%d at %H:%M')" >> $GITHUB_ENV | |
echo "Installing github.com/mitchellh/gox" | |
go install github.com/mitchellh/gox@latest | |
echo "Building for specified os arch" | |
gox -osarch="linux/amd64 linux/arm darwin/amd64 darwin/arm64 windows/amd64 windows/386" ./cmd/reddit-dl/ | |
echo "Done" | |
echo "Archiving files with tar" | |
tar -czvf reddit-dl_linux.tar.gz reddit-dl_linux_{amd64,arm} | |
tar -czvf reddit-dl_darwin.tar.gz reddit-dl_darwin_{amd64,arm64} | |
tar -czvf reddit-dl_windows.tar.gz reddit-dl_windows_{amd64,386}.exe | |
echo "Done" | |
- name: Create Release | |
uses: softprops/[email protected] | |
with: | |
name: ${{ env.RNAME }} | |
body: ${{ env.RTXT }} | |
tag_name: 'build' | |
files: | | |
reddit-dl_linux.tar.gz | |
reddit-dl_darwin.tar.gz | |
reddit-dl_windows.tar.gz |