From db73d859c3e337586e56e2e5a84915388374189d Mon Sep 17 00:00:00 2001 From: Ricardo Loureiro Date: Tue, 19 Dec 2023 12:32:49 +0000 Subject: [PATCH] Add automatic Wally publishing Helps with #6 --- .github/workflows/release.yml | 72 ++++++++++++++++++++++++++++------- .github/workflows/wally.yml | 26 ------------- 2 files changed, 58 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/wally.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc03e00..9d21580 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,21 +1,18 @@ name: Build and Publish Binaries -run-name: Release binaries for ${{ github.ref_name }} by @${{ github.actor }} +run-name: Release binaries and publish to Wally by @${{ github.actor }} on: - release: - types: [created] - -permissions: - contents: write - -concurrency: - group: "release" - cancel-in-progress: true + push: + paths: + - 'wally.toml' jobs: build: runs-on: ubuntu-latest + outputs: + version: ${{ fromJSON(steps.set_manifest.outputs.manifest).package.version }} + steps: - name: Checkout uses: actions/checkout@v4 @@ -24,12 +21,59 @@ jobs: - name: Setup Aftman uses: ok-nick/setup-aftman@v0.4.2 with: - token: ${{ secrets.GITHUB_TOKEN }} + cache: true + - name: Build run: rojo build -o SentrySDK.rbxm # Upload steps - - name: Release - uses: softprops/action-gh-release@v1 + - name: Upload + uses: actions/upload-artifact@v4 + with: + path: "SentrySDK.rbxm" + + - name: Set Manifest + id: set_manifest + run: echo "manifest=$(wally manifest-to-json)" >> $GITHUB_OUTPUT + + deploy: + if: github.ref == 'refs/heads/main' + + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Aftman + uses: ok-nick/setup-aftman@v0.4.2 + with: + cache: true + + - name: Log in to wally + env: + WALLY_AUTH: ${{ secrets.WALLY_AUTH }} + run: | + mkdir ~/.wally + printenv WALLY_AUTH > ~/.wally/auth.toml + + - name: Push update to wally + run: wally publish + + release: + needs: [build, deploy] + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Download + uses: actions/download-artifact@v4 + + - uses: ncipollo/release-action@v1 with: - files: SentrySDK.rbxm + tag: v${{ needs.build.outputs.version }} + commit: ${{ github.head_ref || github.ref_name }} + artifacts: SentrySDK.rbxm diff --git a/.github/workflows/wally.yml b/.github/workflows/wally.yml deleted file mode 100644 index 505c4d1..0000000 --- a/.github/workflows/wally.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish to Wally -run-name: Publish package to wally for ${{ github.ref_name }} by @${{ github.actor }} - -on: - workflow_dispatch: - release: - -concurrency: - group: "wally-release" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Aftman - uses: ok-nick/setup-aftman@v0.4.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Login - run: wally login --token "${{ secrets.WALLY_AUTH }}" - - name: Publish - run: wally publish