Skip to content

Commit

Permalink
ci: replace Releaser/circleCI with release-please/Github Actions (#29)
Browse files Browse the repository at this point in the history
This PR synchronizes the internal repo with public. It replaces CircleCI with Github Actions, and releaser configuration with `release-please`.

---------

Co-authored-by: hroederld <[email protected]>
Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: LaunchDarklyCI <[email protected]>
Co-authored-by: ember-stevens <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com>
Co-authored-by: Kane Parkinson <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: Sarah Day <[email protected]>
  • Loading branch information
11 people authored Dec 18, 2023
1 parent d643629 commit b0579a8
Show file tree
Hide file tree
Showing 22 changed files with 226 additions and 146 deletions.
97 changes: 0 additions & 97 deletions .circleci/config.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Build Documentation
description: 'Build Documentation.'

runs:
using: composite
steps:
- name: Build Documentation
shell: bash
run: ./scripts/build-docs.sh docs
42 changes: 42 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI Workflow
description: 'Shared CI workflow.'
inputs:
lua-version:
description: 'Version of Lua to use for building and testing.'
required: true

runs:
using: composite
steps:
- uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e
with:
luaVersion: ${{ inputs.lua-version }}
- uses: leafo/gh-actions-luarocks@e65774a6386cb4f24e293dca7fc4ff89165b64c5
- name: Install C Server-side SDK Dependencies
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y libhiredis-dev
- name: Setup C Server-side SDK
shell: bash
run: ./scripts/build-c-server.sh

- name: Build Lua Server-side SDK
shell: bash
run: luarocks make launchdarkly-server-sdk-1.0-0.rockspec

- name: Build Lua Server-side SDK with Redis
shell: bash
run: luarocks make launchdarkly-server-sdk-redis-1.0-0.rockspec

- name: Run tests
shell: bash
if: ${{ ! contains(inputs.lua-version, 'jit') }}
run: lua test.lua

- name: Run tests (JIT)
shell: bash
if: ${{ contains(inputs.lua-version, 'jit') }}
run: luajit test.lua
15 changes: 15 additions & 0 deletions .github/actions/publish-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish Documentation
description: 'Publish the documentation to GitHub pages'
inputs:
token:
description: 'Token to use for publishing.'
required: true

runs:
using: composite
steps:
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Publish to Github pages'
with:
docs_path: docs
github_token: ${{ inputs.token }}
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**Requirements**

- [ ] I have added test coverage for new or changed functionality
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform versions

**Related issues**
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run CI
on:
push:
branches: [ main ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'

jobs:
linux-build:
runs-on: ubuntu-latest

strategy:
matrix:
version: ["5.1", "5.2", "5.3", "luajit-2.0.5"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # If you only need the current version keep this.

- uses: ./.github/actions/ci
with:
lua-version: ${{ matrix.version }}
12 changes: 12 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint PR title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
lint-pr-title:
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
25 changes: 25 additions & 0 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
workflow_dispatch:

name: Publish Documentation
jobs:
build-publish:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to write github pages.

steps:
- uses: actions/checkout@v4

- name: Build and Test
uses: ./.github/actions/ci
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build documentation
uses: ./.github/actions/build-docs

- name: Publish Documentation
uses: ./.github/actions/publish-docs
with:
token: ${{secrets.GITHUB_TOKEN}}
42 changes: 42 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run Release Please

on:
push:
branches:
- main

jobs:
release-package:
runs-on: ubuntu-latest

permissions:
contents: write # Contents and pull-requests are for release-please to make releases.
pull-requests: write

steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{ secrets.GITHUB_TOKEN }}
default-branch: main

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}
with:
fetch-depth: 0 # If you only need the current version keep this.

- name: Build and Test
if: ${{ steps.release.outputs.releases_created }}
uses: ./.github/actions/ci
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build documentation
if: ${{ steps.release.outputs.releases_created }}
uses: ./.github/actions/build-docs

- uses: ./.github/actions/publish-docs
if: ${{ steps.release.outputs.releases_created }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
# Happen once per day at 1:30 AM
- cron: '30 1 * * *'

jobs:
sdk-close-stale:
uses: launchdarkly/gh-actions/.github/workflows/sdk-stale.yml@main
14 changes: 0 additions & 14 deletions .ldrelease/build-docs.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .ldrelease/config.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .ldrelease/prepare.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .ldrelease/update-version.sh

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.2.2"
}
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Repository Maintainers
* @launchdarkly/team-sdk-c
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
LaunchDarkly Server-Side SDK for Lua
===========================

[![CircleCI](https://circleci.com/gh/launchdarkly/lua-server-sdk.svg?style=svg)](https://circleci.com/gh/launchdarkly/lua-server-sdk)
[![Actions Status](https://github.com/launchdarkly/lua-server-sdk-private/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/lua-server-sdk/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8)](https://launchdarkly.github.io/lua-server-sdk)

LaunchDarkly overview
-------------------------

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Expand All @@ -28,7 +29,7 @@ Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/l
Learn more
-----------

Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/server-side/lua).
Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/server-side/lua).

Testing
-------
Expand Down
2 changes: 1 addition & 1 deletion launchdarkly-server-sdk-1.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0-0"

source = {
url = "git+https://github.com/launchdarkly/lua-server-sdk.git",
tag = "1.0.0"
tag = "1.2.2" -- {{ x-release-please-version }}
}

dependencies = {
Expand Down
2 changes: 1 addition & 1 deletion launchdarkly-server-sdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Server-side SDK for LaunchDarkly.

#include <launchdarkly/api.h>

#define SDKVersion "1.2.2"
#define SDKVersion "1.2.2" /* {x-release-please-version} */

static struct LDJSON *
LuaValueToJSON(lua_State *const l, const int i);
Expand Down
Loading

0 comments on commit b0579a8

Please sign in to comment.