From ae0dff9dfb91bee59d227e83a5ce4cffc5789e17 Mon Sep 17 00:00:00 2001 From: PipeItToDevNull <25917750+PipeItToDevNull@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:06:45 -0500 Subject: [PATCH] Workflow refinement (#15) * change to be a proper release and scheduled * remove tag_name to see what do * fancy tab declaration and limiting pushes to only master branch * lol, stopped it from running on my branch * need to add a stupid name to the command * re-arrange commands * remove workflow-testing and make proper release * run on any branch but master --- .github/workflows/build-release.yml | 34 +++++++++++++++--------- .github/workflows/build-testing.yml | 40 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-testing.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 5c5b6ed..f1582c9 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,43 +1,53 @@ name: Build and release ISO on: - workflow_dispatch: push: - + branches: + - master + schedule: + - cron: "0 0 1 * *" jobs: - build: permissions: contents: write runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 + - name: Build the Docker image run: docker build . --file Dockerfile --tag build:latest - - name: Run container and build ISO run: | docker run --volume ${{ github.workspace }}:/repo --privileged --name build build:latest mv live-image-amd64.iso rTS_RescueMedia.iso - - name: Upload testing release to GitHub + - name: Tag the repository + id: tag + run: | + # See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names + TAG=v$(date -Iseconds | sed 's/[T:\+]/-/g') + echo "$TAG" + echo "tag=$TAG" >> $GITHUB_OUTPUT + git config user.name "GitHub Action" + git config user.email "admin@rtech.support" + git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA} + git push origin $TAG + + - name: Upload release to GitHub uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') != true with: files: ./rTS_RescueMedia.iso - name: testing - prerelease: true - tag_name: testing + prerelease: false + tag_name: ${{ steps.tag.outputs.tag }} generate_release_notes: true - + - name: Release new Version uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: ./rTS_RescueMedia.iso - generate_release_notes: true - + generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml new file mode 100644 index 0000000..57d320c --- /dev/null +++ b/.github/workflows/build-testing.yml @@ -0,0 +1,40 @@ +name: Build and pre-release testing ISO + +on: + workflow_dispatch: + push: + branches-ignore: + - master + +jobs: + build: + permissions: + contents: write + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag build:latest + + - name: Run container and build ISO + run: | + docker run --volume ${{ github.workspace }}:/repo --privileged --name build build:latest + mv live-image-amd64.iso rTS_RescueMedia.iso + + - name: Upload testing release to GitHub + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') != true + with: + files: ./rTS_RescueMedia.iso + name: testing + prerelease: true + tag_name: testing + generate_release_notes: true + + - name: Release new Version + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./rTS_RescueMedia.iso + generate_release_notes: true \ No newline at end of file