Skip to content

Commit

Permalink
Merge pull request #9 from radu-matei/feat/golang
Browse files Browse the repository at this point in the history
  • Loading branch information
radu-matei authored Apr 6, 2023
2 parents 7e701ca + 6ab2629 commit b40c500
Show file tree
Hide file tree
Showing 19 changed files with 604 additions and 3,867 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install nodejs
uses: actions/setup-node@v3
- name: Setup TinyGo
uses: rajatjindal/setup-actions/[email protected]
id: setup
with:
node-version: 16

- name: Install NPM dependencies for explorer
shell: bash
run: |
cd explorer
npm install -
version: "v0.27.0"

- name: Install Spin canary
uses: engineerd/[email protected]
Expand All @@ -28,12 +23,6 @@ jobs:
url: "https://github.com/fermyon/spin/releases/download/canary/spin-canary-linux-amd64.tar.gz"
pathInArchive: "spin"

- name: Install the Spin JS plugin
shell: bash
run: |
spin plugin update
spin plugin install js2wasm -y
- name: Build application
shell: bash
run: |
Expand Down
63 changes: 38 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ on:
permissions: write-all

jobs:
build:
name: Build and release explorer
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2

- name: Setup `spin`
uses: fermyon/actions/spin/setup@v1

assets:
name: Build and release assets
runs-on: "ubuntu-latest"
Expand All @@ -33,28 +42,32 @@ jobs:
url: "https://github.com/fermyon/spin/releases/download/canary/spin-canary-linux-amd64.tar.gz"
pathInArchive: "spin"

- name: Install the Spin JS plugin
shell: bash
run: |
spin plugin update
spin plugin install js2wasm -y
- name: Build application
shell: bash
run: |
spin build
- name: set the release version (tag)
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: generate checksums
run: |
sha256sum explorer/target/spin-kv-explorer.wasm > checksums-${{ env.RELEASE_VERSION }}.txt
- name: Create release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
generate_release_notes: true
files: |
explorer/target/spin-kv-explorer.wasm
checksums-${{ env.RELEASE_VERSION }}.txt
# Currently, the explorer is built with the dev branch of TinyGo.
# Until there is a release of TinyGo, the binary is added manually
# to the GitHub release.
#
# - name: Install the Spin JS plugin
# shell: bash
# run: |
# spin plugin update
# spin plugin install js2wasm -y
#
# - name: Build application
# shell: bash
# run: |
# spin build
#
# - name: set the release version (tag)
# run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
#
# - name: generate checksums
# run: |
# sha256sum explorer/target/spin-kv-explorer.wasm > checksums-${{ env.RELEASE_VERSION }}.txt
# - name: Create release
# uses: softprops/action-gh-release@v1
# with:
# fail_on_unmatched_files: true
# generate_release_notes: true
# files: |
# explorer/target/spin-kv-explorer.wasm
# checksums-${{ env.RELEASE_VERSION }}.txt
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
main.wasm
.spin/
6 changes: 2 additions & 4 deletions explorer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules
dist
target
.spin/
main.wasm
.spin/
18 changes: 0 additions & 18 deletions explorer/README.md

This file was deleted.

9 changes: 9 additions & 0 deletions explorer/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/golang_explorer

go 1.17

require github.com/fermyon/spin/sdk/go v1.0.0

require github.com/julienschmidt/httprouter v1.3.0 // indirect

replace github.com/fermyon/spin/sdk/go v1.0.0 => github.com/radu-matei/spin/sdk/go v0.0.0-20230406224338-9d78631f2c2b
4 changes: 4 additions & 0 deletions explorer/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/radu-matei/spin/sdk/go v0.0.0-20230406224338-9d78631f2c2b h1:YjGlkvD2pkytU/DdJI+Bg6Zc73SNLToCcKQjKV3H5pc=
github.com/radu-matei/spin/sdk/go v0.0.0-20230406224338-9d78631f2c2b/go.mod h1:yb8lGesopgj/GwPzLPATxcOeqWZT/HjrzEFfwbztAXE=
Loading

0 comments on commit b40c500

Please sign in to comment.