From 3304ca0a41e7d8c0a8cc1c6e806c5500375ba7bf Mon Sep 17 00:00:00 2001 From: Robb Date: Thu, 22 Jun 2023 17:29:37 -0500 Subject: [PATCH] Upload artifacts to allow passing between jobs --- .github/workflows/build-base.yml | 10 +++++++-- .github/workflows/build.yml | 16 -------------- .github/workflows/release.yml | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-base.yml b/.github/workflows/build-base.yml index 3e4888e..0eebbea 100644 --- a/.github/workflows/build-base.yml +++ b/.github/workflows/build-base.yml @@ -12,8 +12,6 @@ jobs: GOOS: windows GOARCH: amd64 - permissions: write-all - steps: - uses: actions/checkout@v2 @@ -27,3 +25,11 @@ jobs: - name: Build run: go build + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: version + path: | + SMEI.exe + README.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7584558..b6dd984 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,19 +8,3 @@ on: jobs: build: uses: ./.github/workflows/build-base.yml - - upload: - name: "Upload artifacts" - runs-on: "ubuntu-latest" - - needs: build - - permissions: write-all - - steps: - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: executable - path: | - SMEI.exe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a294bf8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: "release" + +on: + push: + branches: + # - 'main' + - 'auto-prerelease' # TODO change this to main once working + +jobs: + build: + uses: ./.github/workflows/build-base.yml + + release: + name: "Release" + runs-on: "ubuntu-latest" + + needs: build + + permissions: write-all + + steps: + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: version + + - uses: "marvinpinto/action-automatic-releases@latest" + name: Create prerelease + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Automatic Pre-Release" + files: | + README.md + SMEI.exe