Skip to content

Commit

Permalink
chore: add release-please to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
codito authored Oct 12, 2024
1 parent 74d9ad7 commit eb973e0
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Build

on: [push, pull_request]
on:
push:
branches: [master]
pull_request:
branches: [master]

# Required by release-please
permissions:
contents: write
pull-requests: write

jobs:
test:
Expand All @@ -15,7 +24,7 @@ jobs:
HUSKY: 0
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
- name: Install .NET (v8.0)
uses: actions/[email protected]
with:
Expand All @@ -31,6 +40,13 @@ jobs:
with:
name: Noted.${{ matrix.os }}
path: src/Noted/bin/Publish/
- name: Release please
uses: googleapis/release-please-action@v4
id: release
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple

publish:
if: contains(github.ref, 'tags/v') # only publish tagged versions
Expand All @@ -46,11 +62,7 @@ jobs:
- name: Install .NET (v8.0)
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
- name: Extract version
id: extract_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
shell: bash
dotnet-version: 8.x
- name: Build
run: |
dotnet publish src/Noted -c Release --self-contained false -r win-x64 -o ./src/Noted/bin/Portable.win-x64
Expand All @@ -62,11 +74,10 @@ jobs:
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.win-x64.zip ./src/Noted/bin/win-x64 -r
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.linux-x64.zip ./src/Noted/bin/linux-x64 -r
ls -l src/Noted/bin
- name: Create Release
uses: ncipollo/[email protected]
with:
name: Release ${{ steps.extract_version.outputs.version }}
body: |
[Changelog](https:/codito/Noted/blob/master/CHANGELOG.md)
artifacts: "src/Noted/bin/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' src/Noted/bin/*.zip
--repo '${{ github.repository }}'

0 comments on commit eb973e0

Please sign in to comment.