Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 49 additions & 12 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

name: Go
name: Go Build and Release

on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]

Expand All @@ -13,18 +14,54 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
go-version: ['1.20']
go-version: ['1.25']

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Build
shell: bash
run: |
echo "Building project for ${{ matrix.os }}"
if [ "${{ matrix.os }}" == "windows-latest" ]; then
go build -o nm-decryptor.exe ./...
else
go build -o nm-decryptor ./...
fi

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Test
run: go test -v ./...

- name: Upload Artifact
uses: actions/upload-artifact@v4 # FIXED: Updated from v3 to v4
with:
name: nm-decryptor-${{ matrix.os }}
path: |
nm-decryptor*

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Build
run: go build -v ./...
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: release-assets

- name: Test
run: go test -v ./...
- name: Create and Upload GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: release-assets/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading