Skip to content

Commit

Permalink
Meta dev (#67)
Browse files Browse the repository at this point in the history
closes #5 :

- [x] license
- [x] code-of-conduct.md
- [x] contributing.md
- [x] changelog.md
- [x] releasing.md
  • Loading branch information
ahdinosaur committed Oct 1, 2023
1 parent a39b055 commit 2d86139
Show file tree
Hide file tree
Showing 32 changed files with 919 additions and 91 deletions.
22 changes: 14 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
title: '[BUG]'
labels: bug
assignees: ''

---

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:

1. ...
2. ...
3. ...

**Expected behavior**

A clear and concise description of what you expected to happen.

**Screenshots**

If applicable, add screenshots to help explain your problem.

**Device (please complete the following information):**
- OS: [e.g. Debian, macOS]
- OS version: [e.g. Bullseye, 13]
- If web,
- Browser [e.g. Firefox, Chrome]
- If smartphone,
- Device [e.g. OnePlus 9, iPhone 6]

- OS: [e.g. Debian, macOS]
- OS version: [e.g. Bullseye, 13]
- If web,
- Browser [e.g. Firefox, Chrome]
- If smartphone,
- Device [e.g. OnePlus 9, iPhone 6]

**Additional context**

Add any other context about the problem here.
15 changes: 12 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
title: '[FEATURE]'
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**

A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
**How might this be added to Rimu?**

How might be involved in making this change to Rimu?

What effects would this have? Any possible disadvantages?

**What are possible alternatives?**

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context or screenshots about the feature request here.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches:
- main
pull_request:

env:
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ubuntu-latest

strategy:
matrix:
toolchain:
- stable
- 1.70.0 # msrv

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo check

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features

fmt:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check

clippy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy -- -D warnings
190 changes: 190 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# Copyright 2022-2023, axodotdev
# SPDX-License-Identifier: MIT or Apache-2.0
#
# CI that:
#
# * checks for a Git Tag that looks like a release
# * builds artifacts with cargo-dist (archives, installers, hashes)
# * uploads those artifacts to temporary workflow zip
# * on success, uploads the artifacts to a Github Release™
#
# Note that the Github Release™ will be created with a generated
# title/body based on your changelogs.
name: Release

permissions:
contents: write

# This task will run whenever you push a git tag that looks like a version
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
#
# If PACKAGE_NAME is specified, then the release will be for that
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
#
# If PACKAGE_NAME isn't specified, then the release will be for all
# (cargo-dist-able) packages in the workspace with that version (this mode is
# intended for workspaces with only one dist-able package, or with all dist-able
# packages versioned/released in lockstep).
#
# If you push multiple tags at once, separate instances of this workflow will
# spin up, creating an independent Github Release™ for each one. However Github
# will hard limit this to 3 tags per commit, as it will assume more tags is a
# mistake.
#
# If there's a prerelease-style suffix to the version, then the Github Release™
# will be marked as a prerelease.
on:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
pull_request:

jobs:
# Run 'cargo dist plan' to determine what tasks we need to do
plan:
runs-on: ubuntu-latest
outputs:
val: ${{ steps.plan.outputs.manifest }}
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
publishing: ${{ !github.event.pull_request }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0/cargo-dist-installer.sh | sh"
- id: plan
run: |
cargo dist plan ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} --output-format=json > dist-manifest.json
echo "cargo dist plan ran successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist-manifest.json

# Build and packages all the platform-specific things
upload-local-artifacts:
# Let the initial task tell us to not run (currently very blunt)
needs: plan
if: ${{ fromJson(needs.plan.outputs.val).releases != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
strategy:
fail-fast: false
# Target platforms/runners are computed by cargo-dist in create-release.
# Each member of the matrix has the following arguments:
#
# - runner: the github runner
# - dist-args: cli flags to pass to cargo dist
# - install-dist: expression to run to install cargo-dist on the runner
#
# Typically there will be:
# - 1 "global" task that builds universal installers
# - N "local" tasks that build each platform's binaries and platform-specific installers
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
runs-on: ${{ matrix.runner }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: swatinem/rust-cache@v2
- name: Install cargo-dist
run: ${{ matrix.install_dist }}
- id: cargo-dist
# We force bash here just because github makes it really hard to get values up
# to "real" actions without writing to env-vars, and writing to env-vars has
# inconsistent syntax between shell and powershell. cargo-dist and jq work fine
# in powershell.
shell: bash
run: |
# Actually do builds and make zips and whatnot
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
echo "cargo dist ran successfully"
# Parse out what we just built and upload it to the Github Release™
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: "Upload artifacts"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{ steps.cargo-dist.outputs.paths }}

# Build and package all the platform-agnostic(ish) things
upload-global-artifacts:
needs: [plan, upload-local-artifacts]
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0/cargo-dist-installer.sh | sh"
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
path: target/distrib/
- id: cargo-dist
shell: bash
run: |
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
echo "cargo dist ran successfully"
# Parse out what we just built and upload it to the Github Release™
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: "Upload artifacts"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{ steps.cargo-dist.outputs.paths }}

should-publish:
needs:
- plan
- upload-local-artifacts
- upload-global-artifacts
if: ${{ needs.plan.outputs.publishing == 'true' }}
runs-on: ubuntu-latest
steps:
- name: print tag
run: echo "ok we're publishing!"

# Create a Github Release with all the results once everything is done,
publish-release:
needs: [plan, should-publish]
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Download artifacts"
uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.plan.outputs.val).announcement_title }}
body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Changelog

with help from [`git log`](https://www.git-scm.com/docs/git-log):

```shell
git log --oneline --format="- [%h](https://github.com/ahdinosaur/rimu/commit/%H): %s"
```

## unreleased

- [a39b055](https://github.com/ahdinosaur/rimu/commit/a39b0559540edfdb3b72d5daaeab980f03da71bc): Native functions and a standard library (#65)
- [5fdc3e5](https://github.com/ahdinosaur/rimu/commit/5fdc3e5e0265d608edd8a867595391e7935185e7): Another pass on the docs and playground (#64)
- [6e42351](https://github.com/ahdinosaur/rimu/commit/6e423516d2e69d289fa4f16b919e496cbd9d5757): Support function closures (#62)
- [2b5553c](https://github.com/ahdinosaur/rimu/commit/2b5553cbdbdb2ba4b9bc012b00cb818075529220): remove wee_alloc, use standard allocator
- [b5569d9](https://github.com/ahdinosaur/rimu/commit/b5569d9d1006024081fc81ccbdc474a4bf4395ed): remove leftover file
- [ce6066e](https://github.com/ahdinosaur/rimu/commit/ce6066ee018f1d85a354db258a152ca96b78f48d): Lezer syntax highlighting (#59)
- [3a47beb](https://github.com/ahdinosaur/rimu/commit/3a47bebaf15026dc13ccb6138c222ba80effee66): Wake up babe new syntax just dropped (#58)
- [22726d2](https://github.com/ahdinosaur/rimu/commit/22726d2af65674d158c0546f491195cbd45b098d): Fun fun functions (#57)
- [021664d](https://github.com/ahdinosaur/rimu/commit/021664dd7b427ddf4400e18ba58f983e687e9142): fix block operations error (#56)

## 0.1.0

- [e28fe9f](https://github.com/ahdinosaur/rimu/commit/e28fe9f41c4a77e18f46e8015d04afd2eb3cba40): rename packages, prep for crates publish
- [114d390](https://github.com/ahdinosaur/rimu/commit/114d390bd9d7db2cf9e9c582071eec31178521d0): First pass at documentation site (#25)
- [26ff66b](https://github.com/ahdinosaur/rimu/commit/26ff66b1979a78be3ff819151da38f63d75d7973): update theme and code without a codemirror reboot (#52)
- [089b5c9](https://github.com/ahdinosaur/rimu/commit/089b5c9d9b2e0ea4329697c761f963bc70b3f2a1): update GitHub issue templates (#45)
- [f07c7b2](https://github.com/ahdinosaur/rimu/commit/f07c7b21bfda402f1fe90145ec99be038a51e5e9): add Playground web app (#41)
- [12fac9a](https://github.com/ahdinosaur/rimu/commit/12fac9af148dafa1bc1d8eccaa64480d6183f2dd): change from `BTreeMap` to `IndexMap`: preserve order (#40)
- [4fcb2db](https://github.com/ahdinosaur/rimu/commit/4fcb2db37672af70dccbde9060e8f83a0cde6779): reorganize crates (#38)
- [212baf5](https://github.com/ahdinosaur/rimu/commit/212baf5adae080d884c17a68ed5c73b3d847f06c): truthiness: everything except `false` and `null` is truthy (#37)
- [f2f8f3a](https://github.com/ahdinosaur/rimu/commit/f2f8f3a07e9b62402b00ab40d871da1d5460e5f6): add command-line interface (#36)
- [620af7c](https://github.com/ahdinosaur/rimu/commit/620af7c4dc6494954dc04013f23b587a70dd2c23): finish Block: re-write parser, add evaluator, and replace main lib (#30)
- [d7e8c69](https://github.com/ahdinosaur/rimu/commit/d7e8c6900e0c0ffc4698c4e8eaab1c789867f548): Blocks: lexer (with indents) and parser (#28)
- [837833c](https://github.com/ahdinosaur/rimu/commit/837833c192cf4b82a833007b2d91537dcfbc3197): Revert "rename operations to blocks" (#27)
- [c27213c](https://github.com/ahdinosaur/rimu/commit/c27213c6b37603f4d46f37b9fdda186f8247d7cc): repl errors (#19)
- [331c911](https://github.com/ahdinosaur/rimu/commit/331c9110a00553076fbf7c6ca9824fb033a8e0d7): Expression evaluator and repl (#15)
- [e6bf713](https://github.com/ahdinosaur/rimu/commit/e6bf7133a73af0505efc91ad638dccb29f0dc7b4): Expressions: lexer and parser (#11)
- [d605854](https://github.com/ahdinosaur/rimu/commit/d605854228fcc2e8d4389d50730b9b45edb64a6e): rename operations to blocks (#10)
- [964177c](https://github.com/ahdinosaur/rimu/commit/964177cbdd35b1e19f75efbceae5d29e85fd3f25): add If operation (#8)
- [5926af4](https://github.com/ahdinosaur/rimu/commit/5926af48b3d7a5afc1406bf8693dfa8a96c0ab00): add Let operation (#7)
- [3130490](https://github.com/ahdinosaur/rimu/commit/31304902e3758132764e67ccfa33a745868e8083): split into two crates: `rimu` and `rimu-value` (#1)

## 0.0.1

- [7cdf5f1](https://github.com/ahdinosaur/rimu/commit/7cdf5f183ec79e819de7999e9e138138297d6dac): in the beginning

0 comments on commit 2d86139

Please sign in to comment.