Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use goreleaser for binary releases #57

Merged
merged 2 commits into from
Dec 11, 2023
Merged

Conversation

stefanb
Copy link
Contributor

@stefanb stefanb commented Dec 11, 2023

Test it localy via

goreleaser release --snapshot --clean

See

Note: it is based on #56 to enable also WASM release, so merge that one first.

Log & artefacts:

$ goreleaser release --snapshot --clean
  • starting release...
  • loading                                          path=.goreleaser.yaml
  • skipping announce, publish and validate...
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=37d5b38e9e68446de8c6a2b714dd63cbbb10ec60 branch=goreleaser current_tag=v0.0.2 previous_tag=v0.0.1 dirty=true
    • pipe skipped                                   reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • snapshotting
    • building snapshot...                           version=0.0.2-SNAPSHOT-37d5b38
  • checking distribution directory
    • cleaning dist
  • loading go mod information
  • build prerequisites
  • writing effective config file
    • writing                                        config=dist/config.yaml
  • building binaries
    • building                                       binary=dist/rye_js_wasm/rye.wasm
    • building                                       binary=dist/rye_linux_arm_6/rye
    • building                                       binary=dist/rye_darwin_arm64/rye
    • building                                       binary=dist/rye_linux_amd64_v1/rye
    • building                                       binary=dist/rye_linux_arm64/rye
    • building                                       binary=dist/rye_darwin_amd64_v1/rye
    • took: 1s
  • archives
    • creating                                       archive=dist/rye_Linux_x86_64.tar.gz
    • creating                                       archive=dist/rye_Darwin_arm64.tar.gz
    • creating                                       archive=dist/rye_Linux_armv6.tar.gz
    • creating                                       archive=dist/rye_Js_wasm.tar.gz
    • creating                                       archive=dist/rye_Darwin_x86_64.tar.gz
    • creating                                       archive=dist/rye_Linux_arm64.tar.gz
    • took: 2s
  • calculating checksums
  • storing release metadata
    • writing                                        file=dist/artifacts.json
    • writing                                        file=dist/metadata.json
  • release succeeded after 3s
  • thanks for using goreleaser!

$ ls -go dist  
   rwxr-xr-x   3     96 B     Mon Dec 11 21:36:13 2023    rye_darwin_amd64_v1/
   rwxr-xr-x   3     96 B     Mon Dec 11 21:36:13 2023    rye_darwin_arm64/
   rwxr-xr-x   3     96 B     Mon Dec 11 21:36:13 2023    rye_js_wasm/
   rwxr-xr-x   3     96 B     Mon Dec 11 21:36:13 2023    rye_linux_amd64_v1/
   rwxr-xr-x   3     96 B     Mon Dec 11 21:36:13 2023    rye_linux_arm64/
   rwxr-xr-x   3     96 B     Mon Dec 11 21:36:13 2023    rye_linux_arm_6/
   rw-r--r--   1      3 KiB   Mon Dec 11 21:36:14 2023    artifacts.json 
   rw-r--r--   1      3 KiB   Mon Dec 11 21:36:12 2023    config.yaml 
   rw-r--r--   1    235 B     Mon Dec 11 21:36:14 2023    metadata.json 
   rw-r--r--   1    534 B     Mon Dec 11 21:36:14 2023    rye_0.0.2-SNAPSHOT-37d5b38_checksums.txt 
   rw-r--r--   1      2 MiB   Mon Dec 11 21:36:14 2023    rye_Darwin_arm64.tar.gz 
   rw-r--r--   1      2 MiB   Mon Dec 11 21:36:14 2023    rye_Darwin_x86_64.tar.gz 
   rw-r--r--   1      2 MiB   Mon Dec 11 21:36:14 2023    rye_Js_wasm.tar.gz 
   rw-r--r--   1      2 MiB   Mon Dec 11 21:36:14 2023    rye_Linux_arm64.tar.gz 
   rw-r--r--   1      2 MiB   Mon Dec 11 21:36:14 2023    rye_Linux_armv6.tar.gz 
   rw-r--r--   1      2 MiB   Mon Dec 11 21:36:14 2023    rye_Linux_x86_64.tar.gz 

$ file dist/*/*
dist/rye_darwin_amd64_v1/rye: Mach-O 64-bit executable x86_64
dist/rye_darwin_arm64/rye:    Mach-O 64-bit executable arm64
dist/rye_js_wasm/rye.wasm:    WebAssembly (wasm) binary module version 0x1 (MVP)
dist/rye_linux_amd64_v1/rye:  ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=BvkyllO9DKmgwBGw0okp/9IOzaQMcqQ-k88TjCM2M/Jhaq0mPRyttI0A4WFxp_/ojk6qBIr7KOw0HW2whMO, stripped
dist/rye_linux_arm64/rye:     ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=vmfqvDNbY2h5zk2J8PwK/kIYy91BtT26RR-C_1Zbi/CY9fVpG6uG9cKo3MsY04/OTR_gTyQncuzKsKqGQcm, stripped
dist/rye_linux_arm_6/rye:     ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=x0s6M4TlcA7AmatTvVsW/gYSOcnpJ_0SPcMRt_xLK/YImtxyrfJyicKiF45GRj/AZjD675TuYqjMxT1oOw0, stripped

The dummy term package is needed in "display" builtin.
Test it localy via
goreleaser release --snapshot --clean

See
- https://goreleaser.com/
- https:/goreleaser/goreleaser
@refaktor refaktor merged commit 93c1380 into refaktor:main Dec 11, 2023
2 checks passed
@refaktor
Copy link
Owner

Wow! .... This is great and you are tireless!! Thank you very much!

@stefanb stefanb deleted the goreleaser branch December 11, 2023 21:32
@stefanb
Copy link
Contributor Author

stefanb commented Dec 11, 2023

It's intended use is to push a tag via git or via GitHub release, and then it will publish binaries, along with hashes and release notes.

@refaktor
Copy link
Owner

I ran it locally as you proposed. The binaries get built, I ran the rye_linux_amd64_v1/rye locally but the Shell/REPL didn't start. It executed a given rye file normally. I suspect the binary was built with "b_norepl" flag, but I don't see where this is defined.

# goarch: arm

flags:
- -tags=b_tiny,b_norepl
Copy link
Contributor Author

@stefanb stefanb Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@refaktor, here are the release build tags defined, including the b_norepl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because omitting b_norepl tag is not ok for wasm build I made an override:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants