From 025b55c0c29f49c0ec76e1df961275b3543eb3a7 Mon Sep 17 00:00:00 2001 From: nzbr Date: Thu, 17 Nov 2022 23:11:05 +0100 Subject: [PATCH] move release to separate workflow --- .github/workflows/main.yml | 37 ++++------------------------------- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c74f427..2a66281e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,9 @@ name: 'CI' -on: [push, pull_request, release] +on: + push: {} + pull_request: {} + workflow_call: {} jobs: find-tests: @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0d3c5d48 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }}