Skip to content

Commit

Permalink
Merge pull request #8 from SaladTechnologies/internalize-reallocation
Browse files Browse the repository at this point in the history
0.5.0 - Improved reallocation, state file, and more
  • Loading branch information
shawnrushefsky authored Dec 5, 2024
2 parents 8847c01 + b40755d commit 6213eae
Show file tree
Hide file tree
Showing 11 changed files with 1,520 additions and 780 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Create Release

on:
push:
branches:
- main
paths-ignore:
- ".github/**"
- "**.md"
- "**.png"
- ".gitignore"

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Build
run: npm run build-binary

- name: Get version from package.json
id: version
run: echo ::set-output name=version::$(node -p "require('./package.json').version")

- name: Get the PR that was merged into main
id: pr
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed',
base: 'main',
sort: 'updated',
direction: 'desc',
per_page: 1
});
const pr = pulls[0];
// Set the title and body as outputs
return {
title: pr.title,
body: pr.body
};
- name: Make outputs of previous step available
id: pr-output
run: |
echo "::set-output name=title:$(echo ${{ steps.pr.outputs.result }} | jq -r '.title')"
echo "::set-output name=body::$(echo ${{ steps.pr.outputs.result }} | jq -r '.body')"
- name: Create a release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: ${{ steps.pr-output.outputs.title }}
body: ${{ steps.pr-output.outputs.body }}
draft: false
prerelease: false

- name: Upload release artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ steps.version.outputs.version }} ./bin/kelpie#Linux_x64 --clobber
48 changes: 48 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Release Candidate

on:
pull_request:
branches:
- main
paths-ignore:
- "**.md"
- "**.png"


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Build
run: npm run build-binary

- name: Archive production artifacts
id: archive
uses: actions/upload-artifact@v4
with:
path: bin/kelpie
name: kelpie-${{ github.sha }}

- name: Comment on PR with link
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `:rocket: [Download the latest release candidate](${{ steps.archive.outputs.artifact-url }}) :rocket:`
})
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.19.0
v20.12.2
Loading

0 comments on commit 6213eae

Please sign in to comment.