Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge appcast into Build CI #14

Merged
merged 4 commits into from
Sep 19, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,67 +32,61 @@ jobs:
chmod a+x appsign.sh || exit 1

- name: Compile with codesign (DEBUG)
if: github.repository_owner == 'acidanthera'
if: github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
env:
MAC_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }}
MAC_ACCOUNT_NAME: ${{ secrets.MAC_ACCOUNT_NAME }}
MAC_ACCOUNT_PASSWORD: ${{ secrets.MAC_ACCOUNT_PASSWORD }}
run: DEPLOY_SCRIPT="$(pwd)/appsign.sh" xcodebuild -jobs 1 -configuration Debug

- name: Compile with codesign (RELEASE)
if: github.repository_owner == 'acidanthera'
if: github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
env:
MAC_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }}
MAC_ACCOUNT_NAME: ${{ secrets.MAC_ACCOUNT_NAME }}
MAC_ACCOUNT_PASSWORD: ${{ secrets.MAC_ACCOUNT_PASSWORD }}
run: DEPLOY_SCRIPT="$(pwd)/appsign.sh" xcodebuild -jobs 1 -configuration Release

- name: Compile (DEBUG)
if: github.repository_owner != 'acidanthera'
if: github.repository_owner != 'acidanthera' || github.event_name == 'pull_request'
run: xcodebuild -jobs 1 -configuration Debug

- name: Compile (RELEASE)
if: github.repository_owner != 'acidanthera'
if: github.repository_owner != 'acidanthera' || github.event_name == 'pull_request'
run: xcodebuild -jobs 1 -configuration Release

- name: Upload to Artifacts
if: github.repository_owner == 'acidanthera'
if: github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/*/*.dmg

- name: Upload to Release
if: github.event_name == 'release' && github.repository_owner == 'acidanthera'
if: github.event_name == 'release' && github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is always true, no need to check for pull_request here and below where there is a release check already.

uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/*/*.dmg
tag: ${{ github.ref }}
file_glob: true

appcast:
name: Set Appcast
needs: build
runs-on: macos-latest
env:
JOB_TYPE: BUILD
SIGNATURE_FOR_SIGNING: ${{ secrets.SIGNATURE_FOR_SIGNING }}
if: github.event_name == 'release'
steps:
- name: Get Sparkle 1.26
if: github.event_name == 'release' && github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
run: |
curl -L -s "https://github.com/sparkle-project/Sparkle/releases/download/1.26.0/Sparkle-1.26.0.tar.xz" -o Sparkle.tar.xz || exit 1
tar -xf Sparkle.tar.xz || exit 1

- name: Get Information & Sign
if: github.event_name == 'release' && github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
run: |
TAG_VER=${GITHUB_REF/refs\/tags\//}
DATE=$(date -R)
./bin/sign_update -s ${{ secrets.SIGNATURE_FOR_SIGNING }} build/Release/MaciASL-${TAG_VER}-RELEASE.dmg || exit 1
./bin/generate_appcast -o appcast.xml -s ${{ secrets.SIGNATURE_FOR_SIGNING }} --download-url-prefix https://github.com/acidanthera/MaciASL/releases/download/${TAG_VER}/ build/Release || exit 1

- name: Commit Appcast
if: github.event_name == 'release' && github.repository_owner == 'acidanthera' && github.event_name != 'pull_request'
run: |
# The 41898282 identifier comes from the GitHub Actions API: https://api.github.com/users/github-actions%5Bbot%5D.
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down