Skip to content

Commit

Permalink
chore: fixed approval workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvilla committed Sep 13, 2023
1 parent 61d80fd commit 27dde92
Showing 1 changed file with 215 additions and 0 deletions.
215 changes: 215 additions & 0 deletions .github/workflows/desktop-app-cd-nightly-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,220 @@ jobs:
npm install
npm run nightly
build-win:
runs-on: windows-2022
needs: [ build-and-release-core-and-cli, generate-build-identifier ]
steps:
- name: Prepare GIT
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
with:
ref: master

- uses: actions/checkout@v3
if: ${{ env.TEAM_REPOSITORY != '' }}
with:
repository: ${{ env.TEAM_REPOSITORY }}
ref: main
token: ${{ secrets.GH_TOKEN }}
path: leapp-team

- name: Inject Team Feature
if: ${{ env.TEAM_REPOSITORY != '' }}
run: |
mv leapp-team ..
cd ../leapp-team/packages/leapp-team-service
npm run enable-team-features-prod
- name: Build Win desktop app (nightly)
shell: bash
run: |
cd packages/desktop-app
npm install
npm run nightly-win
rm -Rf ./release/win-unpacked
rm -Rf ./release/.cache
rm -Rf ./release/builder-debug.yml
rm -Rf ./release/builder-effective-config.yaml
TAG_VERSION=$(cat nightly-version)
rm "./release/Leapp-$TAG_VERSION-win.zip" ||:
powershell "Compress-Archive './release/Leapp Setup $TAG_VERSION.exe' './release/Leapp-$TAG_VERSION-win.zip'"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
id: release
run: |
cd packages/desktop-app
TAG_VERSION=$(cat nightly-version)
echo "::set-output name=TAG_VERSION::$TAG_VERSION"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}-win.zip
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}-win.zip

build-linux:
runs-on: ubuntu-latest
needs: [ build-and-release-core-and-cli ]
steps:
- uses: actions/checkout@v3
with:
ref: master
- uses: actions/checkout@v3
if: ${{ env.TEAM_REPOSITORY != '' }}
with:
repository: ${{ env.TEAM_REPOSITORY }}
ref: main
token: ${{ secrets.GH_TOKEN }}
path: leapp-team
- name: Inject Team Feature
if: ${{ env.TEAM_REPOSITORY != '' }}
run: |
mv leapp-team ..
cd ../leapp-team/packages/leapp-team-service
npm run enable-team-features-prod
- name: Build Linux desktop app (nightly)
run: |
cd packages/desktop-app
npm install
npm run nightly-linux
rm -Rf ./release/linux-unpacked
rm -Rf ./release/.cache
rm -Rf ./release/builder-debug.yml
rm -Rf ./release/builder-effective-config.yaml
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
id: release
run: |
cd packages/desktop-app
TAG_VERSION=$(cat nightly-version)
echo "::set-output name=TAG_VERSION::$TAG_VERSION"
- name: Upload artifacts (.deb)
uses: actions/upload-artifact@v3
with:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}_amd64.deb
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}_amd64.deb

- name: Upload artifacts (.AppImage)
uses: actions/upload-artifact@v3
with:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}.AppImage
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}.AppImage

build-macos-x64:
runs-on: macos-latest
needs: [ build-and-release-core-and-cli ]
steps:
- uses: actions/checkout@v3
with:
ref: master

- uses: actions/checkout@v3
if: ${{ env.TEAM_REPOSITORY != '' }}
with:
repository: ${{ env.TEAM_REPOSITORY }}
ref: main
token: ${{ secrets.GH_TOKEN }}
path: leapp-team
- name: Inject Team Feature
if: ${{ env.TEAM_REPOSITORY != '' }}
run: |
mv leapp-team ..
cd ../leapp-team/packages/leapp-team-service
npm run enable-team-features-prod
- name: Build macOS x64 desktop app (nightly)
uses: nick-fields/retry@v2
env:
APPLE_NOTARISATION_PASSWORD: ${{ secrets.APPLE_NOTARISATION_PASSWORD }}
with:
timeout_minutes: 20
max_attempts: 5
command: |
cd packages/desktop-app
KEY_CHAIN=build.keychain
CERTIFICATE_P12=certificate.p12
CERTIFICATE_APPLICATION_P12=certificate-application.p12
echo "Recreate the certificate from the secure environment variable"
echo "security create-keychain"
echo "${{ env.CERTIFICATE_OSX_P12 }}" | base64 --decode > $CERTIFICATE_P12
echo "${{ env.CERTIFICATE_APPLICATION_OSX_P12 }}" | base64 --decode > $CERTIFICATE_APPLICATION_P12
security create-keychain -p ${{ env.KEYCHAIN_PASSWORD }} $KEY_CHAIN
echo "security list-keychains"
security list-keychains -s login.keychain build.keychain
echo "security default-keychain"
security default-keychain -s $KEY_CHAIN
echo "security unlock-keychain"
security unlock-keychain -p ${{ env.KEYCHAIN_PASSWORD }} $KEY_CHAIN
echo "security import"
security import $CERTIFICATE_P12 -k $KEY_CHAIN -P '${{ env.DECODE_PASSWORD }}' -T /usr/bin/codesign;
security import $CERTIFICATE_APPLICATION_P12 -k $KEY_CHAIN -P '${{ env.DECODE_PASSWORD }}' -T /usr/bin/codesign;
echo "security find-identity"
security find-identity -v
echo "security set-key-partition-list"
security set-key-partition-list -S apple-tool:,apple:,codesign:, -s -k ${{ env.KEYCHAIN_PASSWORD }} $KEY_CHAIN
rm -fr *.p12
npm install
npm run set-target-x64
npm run nightly
- name: Clean build
run: |
cd packages/desktop-app
rm -Rf ./release/mac
rm -Rf ./release/mac-unpacked
rm -Rf ./release/.cache
rm -Rf ./release/builder-debug.yml
rm -Rf ./release/builder-effective-config.yaml
TAG_VERSION=$(cat nightly-version)
rm "./release/Leapp-$TAG_VERSION-mac.zip"
rm "./release/Leapp-$TAG_VERSION-mac.zip.blockmap"
zip "./release/Leapp-$TAG_VERSION-mac.zip" "./release/Leapp-$TAG_VERSION.dmg"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
id: release
run: |
cd packages/desktop-app
TAG_VERSION=$(cat nightly-version)
echo "::set-output name=TAG_VERSION::$TAG_VERSION"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}.dmg
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}.dmg


build-macos-arm:
runs-on: macos-latest
needs: [ build-and-release-core-and-cli, generate-build-identifier ]
Expand All @@ -62,6 +276,7 @@ jobs:
ref: development
token: ${{ secrets.GH_TOKEN }}
path: leapp-team

- name: Inject Team Feature
if: ${{ env.TEAM_REPOSITORY != '' }}
run: |
Expand Down

0 comments on commit 27dde92

Please sign in to comment.