Skip to content

Commit

Permalink
Merge pull request #24 from snhane/master
Browse files Browse the repository at this point in the history
feat: provide pre-built binaries for Linux distributions, including Debian-based systems.
  • Loading branch information
GraHms authored Oct 31, 2023
2 parents 30740a7 + 4b4f8c7 commit 2e3b097
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 46 deletions.
78 changes: 33 additions & 45 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,39 @@ name: Go

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
types:
- opened
- edited

permissions:
contents: write

jobs:
dump_tag:
build:
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v3
- run: go mod tidy
- run: go build
- run: go test -v ./...
continue-on-error: true
# temporarily continue even if unit tests fail

create_tag:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
# outputs:
# release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v3
- name: Bump release version and push tag
id: release
uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: false
WITH_V: true
PRERELEASE: false

- name: get the latest tag
Expand All @@ -43,50 +56,25 @@ jobs:
draft: false
prerelease: false

unix:
goreleaser:
needs: create_tag
runs-on: ubuntu-latest
needs: dump_tag
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v4
with:
go-version-file: go.mod

- name: Build samora
run: go build -o "samora" ./main.go

- name: Upload the sml unix asset
id: unix-release-asset
uses: basefas/upload-release-asset-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.dump_tag.outputs.release_id }}
asset_path: samora
asset_name: samora-lang

win:
runs-on: windows-latest
needs: dump_tag
steps:
- uses: actions/checkout@v3

fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Build samora.exe
run: go build -o "samora.exe" ./main.go

- name: Upload samora.exe asset
id: windows-release-asset
uses: basefas/upload-release-asset-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
release_id: ${{ needs.dump_tag.outputs.release_id }}
asset_path: samora.exe
asset_name: samora-lang-win.exe
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea/*
*.iml
*.ipr
dist
19 changes: 19 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
project_name: samora-lang
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
nfpms:
- maintainer: Ismael GraHms <[email protected]>
description: Samora Lang - A Simple Interpreted Programing Language just for Educational Purposes
homepage: https://github.com/GraHms/Samora-Lang
license: MIT
formats:
- deb
- rpm
- apk
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Samora Lang is a simple and expressive programming language designed just for fu

To get started with Samora Lang, follow these steps:

1. Install the Samora Lang compiler and interpreter.
1. Install the Samora Lang compiler and interpreter from the binary corresponding to your OS Architecture.

### Arch Linux
Using the Arch User Repository
Expand Down

0 comments on commit 2e3b097

Please sign in to comment.