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 09c34ad commit 095904b
Show file tree
Hide file tree
Showing 4 changed files with 3,136 additions and 1,939 deletions.
82 changes: 32 additions & 50 deletions .github/workflows/desktop-app-cd-nightly-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
- name: Prepare tag version for artifact upload
id: release
shell: bash
run: |
Expand All @@ -112,6 +112,13 @@ jobs:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}-win.zip
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}-win.zip

- name: Upload to Slack
uses: adrey/slack-file-upload-action@master
with:
token: ${{ secrets.SLACK_TOKEN }}
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}-win.zip
channel: nightly-builds

build-linux:
runs-on: ubuntu-latest
needs: [ build-and-release-core-and-cli, generate-build-identifier ]
Expand Down Expand Up @@ -151,7 +158,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
- name: Prepare tag version for artifact upload
id: release
run: |
cd packages/desktop-app
Expand All @@ -170,6 +177,13 @@ jobs:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}.AppImage
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}.AppImage

- name: Upload to Slack
uses: adrey/slack-file-upload-action@master
with:
token: ${{ secrets.SLACK_TOKEN }}
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}.AppImage
channel: nightly-builds

build-macos-x64:
runs-on: macos-latest
needs: [ build-and-release-core-and-cli, generate-build-identifier ]
Expand Down Expand Up @@ -200,29 +214,6 @@ jobs:
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
Expand All @@ -247,7 +238,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
- name: Prepare tag version for artifact upload
id: release
run: |
cd packages/desktop-app
Expand All @@ -260,6 +251,13 @@ jobs:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}.dmg
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}.dmg

- name: Upload to Slack
uses: adrey/slack-file-upload-action@master
with:
token: ${{ secrets.SLACK_TOKEN }}
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}.dmg
channel: nightly-builds

build-macos-arm:
runs-on: macos-latest
needs: [ build-and-release-core-and-cli, generate-build-identifier ]
Expand Down Expand Up @@ -290,29 +288,6 @@ jobs:
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-arm64
npm run nightly
Expand All @@ -338,7 +313,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: prepare tag version for artifact upload
- name: Prepare tag version for artifact upload
id: release
run: |
cd packages/desktop-app
Expand All @@ -350,3 +325,10 @@ jobs:
with:
name: Leapp-${{ steps.release.outputs.TAG_VERSION }}-arm64.dmg
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}-arm64.dmg

- name: Upload to Slack
uses: adrey/slack-file-upload-action@master
with:
token: ${{ secrets.SLACK_TOKEN }}
path: packages/desktop-app/release/Leapp-${{ steps.release.outputs.TAG_VERSION }}-arm64.dmg
channel: nightly-builds
9 changes: 6 additions & 3 deletions packages/desktop-app/gushio/target-nightly.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const getNightlyVersion = require("../../../gushio/get-nightly-version");
module.exports = {
cli: {
name: 'nightly',
Expand All @@ -24,10 +25,12 @@ module.exports = {
desktopAppPackage = await readPackageJsonFunction(path, "desktop-app");
originalPackage = JSON.parse(JSON.stringify(desktopAppPackage));

const nightlyVersion = desktopAppPackage["version"] + `-nightly.${getNightlyVersion(false)}`;
await fs.writeFile(path.join(__dirname, '..', 'nightly-version'), nightlyVersion)
let nightlyVersion = desktopAppPackage["version"];
if (desktopAppPackage["version"].indexOf("-nightly.") === -1) {
nightlyVersion += `-nightly.${getNightlyVersion(false)}`;
}
await fs.writeFile(path.join(__dirname, '..', 'nightly-version'), nightlyVersion);
desktopAppPackage["version"] = nightlyVersion;
delete desktopAppPackage["build"]["afterSign"];

await writePackageJsonFunction(path, "desktop-app", desktopAppPackage);
await leappCoreBootstrap("desktop-app", () => `npm:@noovolari/leapp-core-nightly@latest`);
Expand Down
5 changes: 3 additions & 2 deletions packages/desktop-app/gushio/target-release-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ module.exports = {

shellJs.cd(path.join(__dirname, '..'));

packageJson["build"]["mac"]["forceCodeSigning"] = true;
packageJson["build"]["mac"]["forceCodeSigning"] = false;
delete packageJson["build"]["afterSign"];
delete packageJson["build"]["win"]["signingHashAlgorithms"];
delete packageJson["build"]["win"]["sign"];
await writePackageJsonFunction(path, "desktop-app", packageJson);

let command;
if (args[1] === 'mac') {
command = `export CSC_IDENTITY_AUTO_DISCOVERY=true && electron-builder build ${platformVersion}`;
command = `export CSC_IDENTITY_AUTO_DISCOVERY=false && electron-builder build ${platformVersion}`;
} else {
command = `electron-builder build ${platformVersion}`;
}
Expand Down
Loading

0 comments on commit 095904b

Please sign in to comment.