feat: add release workflow (#2)

This commit is contained in:
seth
2023-07-19 02:51:10 +00:00
committed by GitHub
parent 16bd754a82
commit a9de6744a1
11 changed files with 90 additions and 92 deletions

30
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Release
on:
release:
types: [published, edited]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.tag_name }}
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Build
run: pnpm install && pnpm build
- uses: JasonEtco/build-and-tag-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}

View File

@@ -3,7 +3,6 @@ name: "Test"
on:
push:
branches: ["main"]
pull_request:
workflow_call:
workflow_dispatch:
@@ -19,12 +18,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Build
run: pnpm install && pnpm build
- name: Install Nix
uses: cachix/install-nix-action@v22
- name: Setup nixpkgs
run: nix-channel --add https://nixos.org/channels/nixpkgs-unstable && nix-channel --update
- name: Setup Attic Cache
uses: ./
with:
@@ -32,5 +37,5 @@ jobs:
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: Build
run: nix-build test.nix
- name: Build Nix Package
run: nix build -f test.nix