Skip to content

Commit

Permalink
ci: reuse build job from ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaro committed Nov 19, 2024
1 parent 9e35d9c commit 767583c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
33 changes: 9 additions & 24 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@ jobs:
uses: ./.github/workflows/ci.yml
secrets: inherit

build:
name: Build
needs: [ci]
runs-on: ubuntu-latest
container: ghcr.io/nikaro/gha:latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v3

- name: Build package
run: task build --yes

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sopsy-dist
path: ./dist/

release:
name: Release
needs: [ci]
Expand All @@ -58,17 +35,25 @@ jobs:
github_token: ${{ github.token }}
no_raise: 3,21

- name: Download artifacts
if: env.PREVIOUS_REVISION != env.REVISION
uses: actions/download-artifact@v4
with:
name: sopsy-dist
path: ./dist/

- name: Release
id: release
if: env.PREVIOUS_REVISION != env.REVISION
uses: softprops/action-gh-release@v2
with:
body_path: _changelog.md
files: ./dist/*
tag_name: ${{ env.REVISION }}

publish:
name: Publish
needs: [build, release]
needs: [release]
if: needs.release.outputs.id != ''
runs-on: ubuntu-latest
permissions:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ jobs:
- name: Build
run: task build --yes

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sopsy-dist
path: ./dist/

check:
name: Check
permissions: {}
Expand Down

0 comments on commit 767583c

Please sign in to comment.