-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the code #16
Conversation
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make | ||
make test | ||
continue-on-error: false | ||
|
||
- name: Build for Linux | ||
run: | | ||
make build | ||
continue-on-error: false | ||
|
||
- name: List Build Directory (for Debugging) | ||
run: ls -R bin | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gogg-linux-amd64 | ||
path: 'bin/gogg' |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
brew install make | ||
make test | ||
continue-on-error: false | ||
|
||
- name: Build for MacOS | ||
run: | | ||
make build-macos | ||
continue-on-error: false | ||
|
||
- name: List Build Directory (for Debugging) | ||
run: ls -R bin | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gogg-macos-universal | ||
path: 'bin/gogg' |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
choco install make -y | ||
make test | ||
continue-on-error: false | ||
|
||
- name: Build for Windows | ||
run: | | ||
make build GOGG_BINARY=gogg.exe | ||
continue-on-error: false | ||
|
||
- name: List Build Directory (for Debugging) | ||
run: ls -R bin | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gogg-windows-amd64 | ||
path: 'bin/gogg.exe' |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install golangci-lint | ||
run: | | ||
make install-deps | ||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make | ||
make install-deps | ||
|
||
- name: Run golangci-lint | ||
run: | | ||
make lint | ||
- name: Run Linters | ||
run: | | ||
make lint | ||
continue-on-error: false |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: windows-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
choco install make -y | ||
make test | ||
|
||
- name: Build Windows Binary | ||
run: | | ||
make build GOGG_BINARY=gogg.exe | ||
|
||
- name: Upload Windows Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gogg-windows | ||
path: bin/gogg.exe | ||
|
||
build-linux: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: macos-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
brew install make | ||
make test | ||
|
||
- name: Build macOS Binary | ||
run: | | ||
make build-macos | ||
|
||
- name: Upload macOS Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gogg-macos | ||
path: bin/gogg | ||
|
||
release: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
runs-on: ubuntu-latest | ||
needs: [ build-windows, build-linux, build-macos ] | ||
steps: | ||
- name: Download Windows Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gogg-windows | ||
path: ./windows | ||
|
||
- name: Download Linux Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gogg-linux | ||
path: ./linux | ||
|
||
- name: Download macOS Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gogg-macos | ||
path: ./macos | ||
|
||
- name: List Downloaded Files (for debugging) | ||
run: ls -R . | ||
|
||
- name: Rename Extracted Binaries | ||
run: | | ||
cd windows && zip -r9 ../gogg-windows-amd64.zip gogg.exe && cd .. | ||
cd linux && zip -r9 ../gogg-linux-amd64.zip gogg && cd .. | ||
cd macos && zip -r9 ../gogg-macos-universal.zip gogg && cd .. | ||
|
||
- name: Create GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: ${{ github.ref_name }} | ||
tag: ${{ github.ref_name }} | ||
body: | | ||
Release version ${{ github.ref_name }} | ||
- Binary builds for Windows, Linux, and macOS | ||
artifacts: | | ||
gogg-windows-amd64.zip | ||
gogg-linux-amd64.zip | ||
gogg-macos-universal.zip | ||
draft: false | ||
prerelease: false |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
cd macos && zip -r9 ../gogg-macos-universal.zip gogg && cd .. | ||
|
||
- name: Create GitHub Release | ||
uses: ncipollo/release-action@v1 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
# Go versions to test against | ||
go-version: [ "1.21", "1.22", "1.23" ] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make | ||
make install-deps | ||
continue-on-error: false | ||
|
||
- name: Run Tests and Generate Coverage Report | ||
run: | | ||
make test # Generates a coverage.txt file for Codecov | ||
continue-on-error: false | ||
|
||
- name: Upload Coverage Reports to Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
continue-on-error: false # Set to true to prevent failing the build if Codecov fails |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
continue-on-error: false | ||
|
||
- name: Upload Coverage Reports to Codecov | ||
uses: codecov/codecov-action@v5 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium test
README.md
and improved the badge styles.CONTRIBUTING.md
and added licensing information for pull requests..editorconfig
to cover YAML and Go files correctly.