From d72631001de1262e8e5d458f037b0191290733e4 Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Fri, 1 Oct 2021 06:50:33 +0200 Subject: [PATCH] Go back to making pre-releases directly from develop branch --- .github/workflows/build.yml | 21 +++++++++++++-------- Scripts/tag-beta.bash | 4 ++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e95749d..0d8710c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,6 @@ jobs: - name: Setup | Checkout uses: actions/checkout@v2 with: - token: ${{secrets.SITE_TOKEN}} submodules: recursive fetch-depth: '0' - name: Setup | Ruby @@ -26,17 +25,16 @@ jobs: xcodebuild -target Package - name: Tag release if: "github.ref == 'refs/heads/develop'" - env: - SITE_TOKEN: ${{ secrets.SITE_TOKEN }} run: | . Scripts/tag-beta.bash - name: Release | Setup - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/develop' run: | Scripts/release-notes.rb Scripts/release-notes.rb > build/Release/Release-notes.md VERSION=$(/usr/libexec/PlistBuddy -c "print :CFBundleShortVersionString" "build/Release/MetaZ.app/Contents/Info.plist") + echo "VERSION=$VERSION" >> $GITHUB_ENV RELEASE_NAME="$(echo "$VERSION" | sed -e 's/.beta-/ Beta /')" echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV mkdir Upload @@ -46,14 +44,21 @@ jobs: mv Upload/MetaZ-*+dSYM.zip Upload/Debug.dSYM.zip mv Upload/MetaZ-*.json Upload/Sparkle.json rm Upload/*.dmg - - name: Release | Create - if: startsWith(github.ref, 'refs/tags/') + - name: Pre-Release + if: github.ref == 'refs/heads/develop' uses: softprops/action-gh-release@v1 with: body_path: build/Release/Release-notes.md - # note you'll typically need to create a personal access token - # with permissions to create releases in the other repo token: ${{ secrets.SITE_TOKEN }} files: 'Upload/*' prerelease: true name: ${{ env.RELEASE_NAME }} + tag_name: v${{ env.VERSION }} + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + body_path: build/Release/Release-notes.md + token: ${{ secrets.SITE_TOKEN }} + files: 'Upload/*' + name: ${{ env.RELEASE_NAME }} diff --git a/Scripts/tag-beta.bash b/Scripts/tag-beta.bash index 827ac62..d879001 100644 --- a/Scripts/tag-beta.bash +++ b/Scripts/tag-beta.bash @@ -10,7 +10,7 @@ if [[ $GITHUB_REF != refs/tags/* ]]; then export GIT_TAG=v${VERSION} echo git tag $GIT_TAG -a -m "Generated tag from CI for build $GITHUB_RUN_NUMBER" git tag $GIT_TAG -a -m "Generated tag from CI for build $GITHUB_RUN_NUMBER" - git push -q https://$SITE_TOKEN@github.com/griff/metaz --tags + git push -q https://$GITHUB_TOKEN@github.com/griff/metaz --tags #export RELEASE_NAME="$(echo "$VERSION" | sed -e 's/.beta-/ Beta /')" fi else @@ -24,7 +24,7 @@ fi # Scripts/release-notes.rb # Scripts/release-notes.rb > build/Release/Release-notes.md # bundle exec Scripts/github_release.rb \ -# --secret "$SITE_TOKEN" \ +# --secret "$GITHUB_TOKEN" \ # --repo-slug griff/metaz \ # --changelog-file build/Release/Release-notes.md \ # --tag $GIT_TAG