From e7626e991ceff1fdebb3b787af126639ae2f7b4d Mon Sep 17 00:00:00 2001 From: Masi Kajander Date: Mon, 24 Jul 2023 20:02:54 +0300 Subject: [PATCH] Add a GitHub action to create a release from a tag --- .github/workflows/build.yml | 11 ++++++++++- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4da8e1..83f0f4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] + workflow_call: jobs: build: @@ -12,6 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 + - name: Run the build script run: ./build.sh + + - name: Store build artifacts + uses: actions/upload-artifact@v3 + with: + name: release-dir + path: release/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dea351d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release BOFH + +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + build: + uses: ./.github/workflows/build.yml + + release: + needs: build + permissions: + contents: write + runs-on: ubuntu-latest + + steps: + - name: Fetch build artifacts + uses: actions/download-artifact@v3 + with: + name: release-dir + - name: Create zip + uses: TheDoctor0/zip-release@0.7.1 + with: + type: zip + filename: bofh-release.zip + exclusions: '*.git*' + + - name: Create release + uses: ncipollo/release-action@v1 + with: + artifacts: bofh-release.zip