Skip to content

Commit

Permalink
move release to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbr committed Nov 17, 2022
1 parent 55f218d commit 025b55c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 33 deletions.
37 changes: 4 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 'CI'

on: [push, pull_request, release]
on:
push: {}
pull_request: {}
workflow_call: {}

jobs:
find-tests:
Expand Down Expand Up @@ -98,35 +101,3 @@ jobs:
shell: pwsh
run: |
Invoke-Pester -Output Detailed ${{ matrix.test }}
release:
if: startsWith(github.ref, 'refs/tags/')
needs:
- checks
- build
- tests
name: Create Release πŸ“’
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download installer πŸ“₯
uses: actions/download-artifact@v3
with:
name: installer

- name: Generate checksums πŸ”‘
run: |
for x in *.tar.gz; do
sha256sum $x > ${x}.sha256
done
- name: Attach to release πŸ“¦
uses: softprops/action-gh-release@v1
with:
files: |
nixos-wsl-installer.tar.gz
nixos-wsl-installer.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Release'

on:
release: {}

jobs:
build:
name: Build πŸ› οΈ
uses: nzbr/nixos-wsl/.github/workflows/main.yml@tests
release:
needs:
- build
name: Create Release πŸ“’
runs-on: ubuntu-latest
steps:
- name: Download installer πŸ“₯
uses: actions/download-artifact@v3
with:
name: installer

- name: Generate checksums πŸ”‘
run: |
for x in *.tar.gz; do
sha256sum $x > ${x}.sha256
done
- name: Attach to release πŸ“¦
uses: softprops/action-gh-release@v1
with:
files: |
nixos-wsl-installer.tar.gz
nixos-wsl-installer.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 025b55c

Please sign in to comment.