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

feat(ci): Add builds for preview binaries #1777

Merged
merged 5 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/build-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ on:
workflow_dispatch:
inputs:
os:
description: "Operating system to run CI on"
description: Operating system to run CI on
type: choice
required: true
default: "ubuntu-latest"
type: choice
options:
- ubuntu-latest
- macos-latest
- windows-latest
ref:
description: Git reference to checkout
type: string
required: false
workflow_call:
inputs:
os:
description: Operating system to run CI on
type: string
required: true
ref:
description: Git reference to checkout
type: string
required: false

jobs:
build:
Expand All @@ -29,6 +38,8 @@ jobs:
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Setup node.js
uses: actions/setup-node@v3.6.0
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ on:
workflow_dispatch:
inputs:
os:
description: "Operating system to run CI on"
description: Operating system to run CI on
type: choice
required: true
default: "ubuntu-latest"
type: choice
options:
- ubuntu-latest
- macos-latest
- windows-latest
ref:
description: Git reference to checkout
type: string
required: false
workflow_call:
inputs:
os:
description: Operating system to run CI on
type: string
required: true
ref:
description: Git reference to checkout
type: string
required: false

jobs:
build:
Expand All @@ -29,6 +38,8 @@ jobs:
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Setup node.js
uses: actions/setup-node@v3.6.0
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Grain CI Workflow

on: [push, pull_request]
# This is to avoid unnecessary runs.
# e.g. push AND pull_request against a PR or push against a tag from workflow runs
# If you need CI to run, you can open a Draft PR to trigger the CI.
on:
push:
branches: [main]
pull_request:
merge_group:

# This will cancel previous runs when a branch or PR is updated
concurrency:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow assumes that a `grain-linux-x64` binary was uploaded earlier within the same Action run.
# It downloads the binary, regenerates the documentation for the project, and pushes it to the ref that was checked out.
# Note: the `ref` should always be a branch for successful pushes!
name: Generate documentation

on:
workflow_call:
inputs:
ref:
description: Git reference to checkout
type: string
required: false
secrets:
PUSH_TOKEN:
description: Token used to push back to repository
required: true

jobs:
generate-docs:
name: Generate documentation
runs-on: ubuntu-latest
steps:
- name: Setup bot user
run: |
git config --global user.email "bot@grain-lang.org"
git config --global user.name "Grain Bot"

- name: Checkout project
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
token: ${{ secrets.PUSH_TOKEN }}

- name: Fetch linux binary
uses: actions/download-artifact@v3
with:
name: grain-linux-x64

- name: Untar download
run: |
tar -xvf grain.tar

- name: Regenerate documentation
run: |
./grain doc stdlib -o stdlib --current-version=$(./grain -v)
git add stdlib
git commit -m 'chore(stdlib): Regenerate markdown documentation'
git push
Loading