From c2d58ebe3a23250248642c602aa82fed5f303620 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Fri, 10 Mar 2023 14:42:27 -0800 Subject: [PATCH] GitHub Automation Updates --- .github/workflows/commit.yml | 42 +++++++---------- .github/workflows/release.yml | 88 ++++++++++++++++++++++++++++------- 2 files changed, 87 insertions(+), 43 deletions(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index bb9f7081..7eb35adb 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -3,10 +3,9 @@ name: Commit Build on: push: branches: - - master - - dev + - '**' tags-ignore: - - v* + - '**' jobs: buildLinux: @@ -14,9 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: rlespinasse/github-slug-action@v4.4.0 - - - uses: actions/checkout@v3.1.0 + - name: Diag + run: | + echo GITHUB_REF: "$GITHUB_REF" + env + + - uses: rlespinasse/github-slug-action@v4.4.1 + + - uses: actions/checkout@v3.3.0 - name: Build run: | @@ -35,28 +39,16 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v3.1.1 with: - name: RomWBW_Linux-${{env.GITHUB_REF_SLUG}}-${{env.GITHUB_SHA_SHORT}} + name: RomWBW-${{env.GITHUB_SHA_SHORT}}-Linux path: . - - name: Create Package Archive - run: | - zip -r RomWBW-SnapShot-Package.zip . - - - name: Post SnapShot - uses: wwarthen/actions/packages/automatic-releases@built-packages - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "SnapShot" - prerelease: true - title: "RomWBW Development SnapShot Build" - files: | - RomWBW-SnapShot-Package.zip - buildMacOS: - runs-on: macOS-12 + runs-on: macOS-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: rlespinasse/github-slug-action@v4.4.1 + + - uses: actions/checkout@v3.3.0 - name: Build run: | @@ -74,5 +66,5 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v3.1.1 with: - name: RomWBW_MacOS - path: . + name: RomWBW-${{env.GITHUB_SHA_SHORT}}-MacOS + path: . \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2816925b..ef71214d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ name: Release Build on: - release: - types: published + push: + tags: + - '**' jobs: build: @@ -11,18 +12,16 @@ jobs: steps: - uses: actions/checkout@v3.3.0 - + - name: Create Package Label run: | + echo GITHUB_REF: "$GITHUB_REF" LABEL=`echo "$GITHUB_REF" | sed "s|^refs/tags/||"` echo "PKGLBL=$LABEL" >> $GITHUB_ENV - - - name: Display Diagnostics - run: | echo PKGLBL: "$PKGLBL" echo Upload URL: "${{github.event.release.upload_url}}" echo GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}" - + - name: Build run: | export TZ='America/Los_Angeles' @@ -30,20 +29,73 @@ jobs: sudo apt-get install srecord make dist rm -rf .git* - - - name: Upload Artifact - uses: actions/upload-artifact@v3.1.1 - with: - name: RomWBW-${{env.PKGLBL}}-Package - path: . - + - name: Create Package Archive run: | zip -r RomWBW-${{env.PKGLBL}}-Package.zip . - - name: Upload Package Archive - uses: AButler/upload-release-assets@v2.0.2 + - name: Attach Package Archive + uses: wwarthen/actions/packages/automatic-releases@built-packages with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: true + title: "RomWBW Development SnapShot ${{env.PKGLBL}}" files: | - RomWBW-${{env.PKGLBL}}-Package.zip \ No newline at end of file + RomWBW-${{env.PKGLBL}}-Package.zip + +# - name: Upload Package Archive +# uses: AButler/upload-release-assets@v2.0.2 +# with: +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# files: | +# RomWBW-${{env.PKGLBL}}-Package.zip + + +# - name: Post SnapShot +# uses: docker://antonyurchenko/git-release:latest +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# RELEASE_NAME_PREFIX: "Development SnapShot Release " +# CHANGELOG_FILE: "none" +# with: +# args: | +# RomWBW-SnapShot-Package.zip + +# - name: Post SnapShot +# uses: cb80/pubrel@latest +# with: +# replace: true +# files: | +# RomWBW-SnapShot-Package.zip + +# - name: Post SnapShot +# uses: wwarthen/actions/packages/automatic-releases@built-packages +# with: +# repo_token: "${{ secrets.GITHUB_TOKEN }}" +# prerelease: true +# title: "RomWBW Development SnapShot ${{env.GITHUB_REF_SLUG}}" +# files: | +# RomWBW-SnapShot-Package.zip + +# - name: Remove Older Releases +# uses: wwarthen/delete-release-action@v1.2 +# with: +# release-drop: true +# release-keep-count: 0 +# release-drop-tag: true +# pre-release-drop: false +# pre-release-keep-count: 0 +# pre-release-drop-tag: true +# draft-drop: true +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# - name: Remove Older Releases +# uses: s00d/delete-older-releases@0.2.1 +# with: +# keep_latest: 1 +## delete_tag_pattern: beta # defaults to "" +# delete_type: 'release' +# delete_branch: 'main' +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}