Skip to content

Commit

Permalink
ci: add semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelPanic92 committed Apr 10, 2024
1 parent 8eac3df commit b35efce
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Dart

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
compile:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
sdk: [ stable ]
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}

- name: Install dependencies
run: make install
- name: Build runners
run: make build_runner
- name: compile
run: make compile
- name: zip
uses: montudor/action-zip@v1
with:
args: zip "{{matrix.os}}.zip" bin/devmy
- name: compile
run: rm devmy
release:
runs-on: ubuntu-latest
needs: [ compile ]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Setup Semantic Release
run: npm i -g semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator semantic-release-dart @semantic-release/changelog @semantic-release/git @semantic-release/github
- name: Run Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ pubspec_overrides.yaml
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/dist/devmy
/tmp
/out-tsc
/bazel-out
/bin/devmy.exe
/bin
!/bin/devmy.dart

# Node
/node_modules
Expand Down
35 changes: 35 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"branches": [
"main",
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"semantic-release-dart",
[
"@semantic-release/github",
{
"assets": [
{ "path": "macos-latest.zip", "label": "MacOS distribution" },
{ "path": "ubuntu-latest.zip", "label": "Linux distribution" }
]
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"pubspec.yaml"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Empty file added dist/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ install:
build_runner:
dart run build_runner build
compile:
dart compile exe bin/devmy.dart
dart compile exe -o dist/devmy bin/devmy.dart
activate:
dart pub global activate -s path . --overwrite

0 comments on commit b35efce

Please sign in to comment.