Skip to content

Commit

Permalink
actions: init
Browse files Browse the repository at this point in the history
  • Loading branch information
hayzamjs committed Sep 5, 2024
1 parent e302938 commit 8fb9248
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.1'

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.15.0'

- name: Install dependencies
run: |
go mod download
cd web && npm install
cd ..
make deps
- name: Create Config
run: cp config.example.json config.json && sed -i 's|<ENDPOINT>|dummy-endpoint|g; s|<ACCESS_KEY_ID>|dummy-access-key-id|g; s|<SECRET_ACCESS>|dummy-secret-access|g; s|<BUCKET_NAME>|dummy-bucket|g; s|<ACCOUNT_ID>|dummy-account-id|g; s|<API_KEY>|dummy-api-key|g; s|<CLIENT_ID>|dummy-client-id|g; s|<CLIENT_SECRET>|dummy-client-secret|g; s|<DIRECTORY_ID>|dummy-directory-id|g; s|<domain>|dummy-domain.com|g; s|<CALLBACK_URL>|dummy-callback-url|g' config.json

- name: Build for all platforms
run: make build

- name: Upload release assets
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/kalmia_${{ github.ref_name }}_linux_amd64
dist/kalmia_${{ github.ref_name }}_linux_arm64
dist/kalmia_${{ github.ref_name }}_win64.exe
dist/kalmia_${{ github.ref_name }}_freebsd64
dist/kalmia_${{ github.ref_name }}_macos64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup build artifacts
run: make clean
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
push:
pull_request:


jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.1'

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.15.0'

- name: Install dependencies
run: |
go mod download
cd web && npm install
cd ..
make deps
- name: Create Config
run: cp config.example.json config.json && sed -i 's|<ENDPOINT>|dummy-endpoint|g; s|<ACCESS_KEY_ID>|dummy-access-key-id|g; s|<SECRET_ACCESS>|dummy-secret-access|g; s|<BUCKET_NAME>|dummy-bucket|g; s|<ACCOUNT_ID>|dummy-account-id|g; s|<API_KEY>|dummy-api-key|g; s|<CLIENT_ID>|dummy-client-id|g; s|<CLIENT_SECRET>|dummy-client-secret|g; s|<DIRECTORY_ID>|dummy-directory-id|g; s|<domain>|dummy-domain.com|g; s|<CALLBACK_URL>|dummy-callback-url|g' config.json

- name: Run tests
run: make test

0 comments on commit 8fb9248

Please sign in to comment.