Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
paths-ignore:
- '**.md'
- 'docs/**'
- .github/**
- '!.github/workflows/ci.yml'
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
- .github/**
- '!.github/workflows/ci.yml'

permissions:
contents: read
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/release-prepare.yml

This file was deleted.

58 changes: 23 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,38 @@
name: Release Create
name: Release Please

on:
pull_request:
types: [closed]
push:
branches:
- main

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read

jobs:
check-release-conditions:
release-please:
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'main' &&
startsWith(github.event.pull_request.head.ref, 'release/v') &&
startsWith(github.event.pull_request.user.login, 'github-actions')

permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag: ${{ steps.release.outputs.tag_name }}
steps:
- name: Check release conditions
run: |
echo "All conditions have been met!"
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release

create-release:
permissions:
contents: write
needs: check-release-conditions
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest

env:
NEXT_RELEASE_TAG: ${{ github.event.pull_request.head.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare Python
uses: actions/setup-python@v5
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
cache: 'pip'

- name: Install dependencies
run: pip install -r ./tools/release/requirements.txt

- name: Extract Tag from branch name
run: |
NEXT_RELEASE_TAG=$(echo $NEXT_RELEASE_TAG | sed 's/^release\///')
echo "NEXT_RELEASE_TAG=${NEXT_RELEASE_TAG}" >> $GITHUB_ENV

- name: Target release Tag
run: echo "New tag $NEXT_RELEASE_TAG"
persist-credentials: false

- name: Setup Ninja
run: sudo apt-get install ninja-build
Expand All @@ -65,4 +50,7 @@ jobs:
cp merve.h merve.cpp ../../singleheader/

- name: Create release
run: ./tools/release/create_release.py
run: gh release upload "$RELEASE_TAG" singleheader/*
env:
GH_TOKEN: ${{ github.token }}
Copy link
Member

Choose a reason for hiding this comment

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

I'll enable immutable releases and see if this properly creates the release or not. (Once it lands)

Ref: https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases

RELEASE_TAG: ${{ needs.release-please.outputs.release_tag }}
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.0.0"
}
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ cmake_minimum_required(VERSION 3.16)
project(merve
DESCRIPTION "Fast lexer to extract named exports via analysis from CommonJS modules"
LANGUAGES C CXX
VERSION 1.0.0
VERSION 1.0.0 # x-release-please-version
)

set(MERVE_LIB_VERSION "1.0.0" CACHE STRING "lexer library version")
set(MERVE_LIB_SOVERSION "1" CACHE STRING "lexer library soversion")
set(MERVE_LIB_VERSION "1.0.0" CACHE STRING "lexer library version") # x-release-please-version
set(MERVE_LIB_SOVERSION "1" CACHE STRING "lexer library soversion") # x-release-please-major

include(GNUInstallDirs)

Expand Down
8 changes: 4 additions & 4 deletions include/merve/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#ifndef MERVE_VERSION_H
#define MERVE_VERSION_H

#define MERVE_VERSION "1.0.0"
#define MERVE_VERSION "1.0.0" // x-release-please-version

namespace lexer {

enum {
MERVE_VERSION_MAJOR = 1,
MERVE_VERSION_MINOR = 0,
MERVE_VERSION_REVISION = 0,
MERVE_VERSION_MAJOR = 1, // x-release-please-major
MERVE_VERSION_MINOR = 0, // x-release-please-minor
MERVE_VERSION_REVISION = 0, // x-release-please-patch
};

} // namespace lexer
Expand Down
11 changes: 11 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"packages": {
".": {
"release-type": "simple",
"extra-files": [
"CMakeLists.txt",
"include/lexer/version.h"
]
}
}
}
Empty file removed tools/release/__init__.py
Empty file.
22 changes: 0 additions & 22 deletions tools/release/create_release.py

This file was deleted.

Empty file removed tools/release/lib/__init__.py
Empty file.
20 changes: 0 additions & 20 deletions tools/release/lib/release.py

This file was deleted.

43 changes: 0 additions & 43 deletions tools/release/lib/versions.py

This file was deleted.

2 changes: 0 additions & 2 deletions tools/release/requirements.txt

This file was deleted.

19 changes: 0 additions & 19 deletions tools/release/update_versions.py

This file was deleted.

Loading