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
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Publish
name: Release

# Triggered by pushing a semver tag (e.g. v2.1.3).
# 1. Creates a GitHub Release with auto-generated notes.
# 2. Builds dist/ and force-pushes action.yml + dist/ to the tag.
# 3. Updates the major version tag (v2.1.3 -> v2).
on:
release:
types: [published, edited]
tags:
- 'v*.*.*'

permissions:
contents: write

jobs:
notify-start:
Expand All @@ -14,17 +21,32 @@ jobs:
slack-channel-id: ${{ vars.SLACK_CHANNEL_ID }}
stage: start

build:
name: Build
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v6
with:
ref: ${{ github.event.release.tag_name }}
node-version: 24
cache: npm

- name: Install deps and build
run: npm ci && npm run build
- uses: JasonEtco/build-and-tag-action@v2

- name: Create GitHub Release with auto-generated notes
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
# Mark as prerelease if the tag contains a hyphen (e.g. v2.1.3-beta.1).
prerelease: ${{ contains(github.ref_name, '-') }}

- name: Build and tag (force-pushes dist/ to the tag and updates major/minor refs)
uses: JasonEtco/build-and-tag-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test.yml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- main
- patch-v1
pull_request:
pull_request: {}
workflow_dispatch: {}

defaults:
run:
Expand Down Expand Up @@ -39,6 +39,7 @@ jobs:
kosli version --short >> $GITHUB_ENV
echo "\n" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV

- name: Verify pinned version
if: matrix.version != 'latest'
shell: python
Expand All @@ -49,6 +50,7 @@ jobs:
sys.exit(
int(not os.environ["KOSLI_VERSION_EXPECTED"] in os.environ["KOSLI_VERSION_INSTALLED"])
)

- name: Verify latest resolved to a semver
if: matrix.version == 'latest'
shell: python
Expand Down