From 266aad49316152c615e9e9e0408fc9bb515d03c0 Mon Sep 17 00:00:00 2001 From: Jaap Blom Date: Fri, 5 Apr 2024 13:04:32 +0200 Subject: [PATCH] added nightly release gha with version bump --- .../_release-with-built-site-as-artifact.yml | 25 +++++++++++++++++++ ...al-release-with-built-site-as-artifact.yml | 21 ++++------------ .../nighly-build-release-with-artefact.yml | 22 ++++++++++++++++ 3 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/_release-with-built-site-as-artifact.yml create mode 100644 .github/workflows/nighly-build-release-with-artefact.yml diff --git a/.github/workflows/_release-with-built-site-as-artifact.yml b/.github/workflows/_release-with-built-site-as-artifact.yml new file mode 100644 index 0000000..ac441df --- /dev/null +++ b/.github/workflows/_release-with-built-site-as-artifact.yml @@ -0,0 +1,25 @@ +name: Release tag with _site.tar.gz artefact +on: + workflow_call: + inputs: + tag: + description: Github Tag to create + required: true + type: string + +jobs: + bundle: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 #v4.1.2 + - uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby?tab=readme-ov-file#versioning + with: + ruby-version: "3.3" # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - run: gem install jekyll bundler + - run: bundle exec jekyll build + - run: tar -cvvzf _site.tar.gz ./_site + - name: Create release + run: gh release create ${{ inputs.tag }} _site.tar.gz + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/manual-release-with-built-site-as-artifact.yml b/.github/workflows/manual-release-with-built-site-as-artifact.yml index ad526fa..6fef93a 100644 --- a/.github/workflows/manual-release-with-built-site-as-artifact.yml +++ b/.github/workflows/manual-release-with-built-site-as-artifact.yml @@ -1,4 +1,4 @@ -name: Manual release from tag +name: Manual release custom tag on: workflow_dispatch: inputs: @@ -8,18 +8,7 @@ on: type: string jobs: - bundle: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 #v4.1.2 - - uses: ruby/setup-ruby@v1 # https://github.com/ruby/setup-ruby?tab=readme-ov-file#versioning - with: - ruby-version: '3.3' # Not needed with a .ruby-version file - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - run: gem install jekyll bundler - - run: bundle exec jekyll build - - run: tar -cvvzf _site.tar.gz ./_site - - name: Create release - run: gh release create ${{ inputs.tag }} _site.tar.gz - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release: + uses: ./.github/workflows/_release-with-built-site-as-artifact.yml + with: + tag: ${{inputs.tag}} diff --git a/.github/workflows/nighly-build-release-with-artefact.yml b/.github/workflows/nighly-build-release-with-artefact.yml new file mode 100644 index 0000000..0ec41fb --- /dev/null +++ b/.github/workflows/nighly-build-release-with-artefact.yml @@ -0,0 +1,22 @@ +name: Nighly release of main branch with bumped tag + +on: + schedule: + - cron: "0 1 * * *" + +jobs: + bump-version: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.bumped-tag.outputs.tag }} + steps: + - id: bumped-tag + run: | + VERSION=`git describe --tags --abbrev=0 | awk -F. '{OFS="."; $NF+=1; print $0}'`; \ + echo "tag=${VERSION}" >> $GITHUB_OUTPUT + + release: + uses: ./.github/workflows/_release-with-built-site-as-artifact.yml + needs: bump-version + with: + tag: ${{needs.bump-version.outputs.tag}}