mirror of
https://github.com/chenasraf/sofmani.git
synced 2026-05-18 01:29:02 +00:00
ci: add workflows
docs: add FUNDING.yml
This commit is contained in:
13
.github/FUNDING.yml
vendored
Normal file
13
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: chenasraf
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: casraf
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom:
|
||||
- "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TSH3C3ABGQM22¤cy_code=ILS&source=url"
|
||||
80
.github/workflows/release.yml
vendored
Normal file
80
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.23'
|
||||
- name: Test
|
||||
run: go test -v
|
||||
|
||||
generate:
|
||||
name: Generate cross-platform builds
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Create dist/ dir
|
||||
run: mkdir dist
|
||||
- name: Generate build files
|
||||
uses: chenasraf/go-cross-build@v1
|
||||
with:
|
||||
platforms: 'linux/amd64, darwin/amd64, windows/amd64' # , darwin/arm64' # '
|
||||
package: ''
|
||||
name: 'sofmani'
|
||||
compress: 'true'
|
||||
dest: 'dist'
|
||||
- name: Upload builds
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
release-please:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test
|
||||
- generate
|
||||
steps:
|
||||
- name: Download builds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
- name: Verify Release Artifacts
|
||||
run: |
|
||||
ls -la dist
|
||||
for i in "linux-amd64" "darwin-amd64" "windows-amd64"; do
|
||||
if [[ ! -f ./dist/sofmani-$i.tar.gz ]]; then
|
||||
echo "File not found: ./dest/sofmani-$i.tar.gz"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
- uses: googleapis/release-please-action@v4
|
||||
id: release
|
||||
with:
|
||||
release-type: simple
|
||||
- name: Upload Release Artifacts
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload ${{ steps.release.outputs.tag_name }} ./dist/sofmani-linux-amd64.tar.gz
|
||||
gh release upload ${{ steps.release.outputs.tag_name }} ./dist/sofmani-darwin-amd64.tar.gz
|
||||
gh release upload ${{ steps.release.outputs.tag_name }} ./dist/sofmani-windows-amd64.zip
|
||||
# gh release upload ${{ steps.release.outputs.tag_name }} ./dist/sofmani-darwin-arm64.tar.gz
|
||||
45
.github/workflows/test.yml
vendored
Normal file
45
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build & Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.23'
|
||||
|
||||
- name: Build
|
||||
run: go build -v
|
||||
|
||||
- name: Test
|
||||
run: go test -v
|
||||
|
||||
- name: Create dist/ dir
|
||||
run: mkdir dist
|
||||
|
||||
- name: Generate build files
|
||||
uses: chenasraf/go-cross-build@v1
|
||||
with:
|
||||
platforms: 'linux/amd64, darwin/amd64, windows/amd64' # , darwin/arm64' # '
|
||||
package: ''
|
||||
name: 'sofmani'
|
||||
compress: 'true'
|
||||
dest: 'dist'
|
||||
- name: Upload builds
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
Reference in New Issue
Block a user