feat(ci): add GHA jobs for release
This commit is contained in:
46
.github/workflows/release.yml
vendored
46
.github/workflows/release.yml
vendored
@@ -16,4 +16,48 @@ jobs:
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: nix flake check
|
||||
- run: nix flake check
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: nix-check
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install Dependencies
|
||||
run: nix develop .#full --command pnpm install
|
||||
|
||||
- name: Create Release Pull Request or Publish
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: nix develop .#full --command pnpm run version
|
||||
publish: nix develop .#full --command pnpm run release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create GitHub Release with Assets
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
uses: softprops/action-gh-release@v5
|
||||
with:
|
||||
tag_name: v${{ steps.changesets.outputs.publishedPackages[0].version }}
|
||||
name: Release v${{ steps.changesets.outputs.publishedPackages[0].version }}
|
||||
files: |
|
||||
packages/*.zip
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user