mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-14 08:06:36 +00:00
Made the upload and release depend on the build job.
- Split up the pipeline to build, publish, and release. - Set a 30 minutes build timeout, to avoid macOS signing issues. - Removed global envs. `env` cannot be accessed for `if` in jobs. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
951884045c
commit
5a353ffaa5
88
.github/workflows/build.yml
vendored
88
.github/workflows/build.yml
vendored
@ -12,11 +12,8 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * *' # run every day at 3AM (https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
|
- cron: '0 3 * * *' # run every day at 3AM (https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
|
||||||
|
|
||||||
env:
|
|
||||||
IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.head_ref == 'gh-actions' }} # TODO: remove OR once PR is merged.
|
|
||||||
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -24,9 +21,8 @@ jobs:
|
|||||||
- os: windows-2016
|
- os: windows-2016
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
- os: turin-macmini # self-hosted macOS
|
- os: turin-macmini # self-hosted macOS
|
||||||
|
|
||||||
runs-on: ${{ matrix.config.os }}
|
runs-on: ${{ matrix.config.os }}
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -42,48 +38,86 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '2.7'
|
python-version: '2.7'
|
||||||
|
|
||||||
- name: Build
|
- name: Update Keychain [macOS]
|
||||||
env:
|
if: runner.OS == 'macOS'
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
run: |
|
||||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
|
echo "${{ secrets.KEYCHAIN }}" | base64 --decode > ~/Library/Keychains/apple-developer.keychain-db
|
||||||
run: yarn
|
security list-keychains -s ~/Library/Keychains/apple-developer.keychain-db
|
||||||
|
security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" ~/Library/Keychains/apple-developer.keychain-db
|
||||||
- name: Test
|
|
||||||
run: yarn test
|
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/Microsoft/vscode/issues/28434#issuecomment-346199674
|
|
||||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
|
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
AC_USERNAME: ${{ secrets.AC_USERNAME }}
|
AC_USERNAME: ${{ secrets.AC_USERNAME }}
|
||||||
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
|
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
IS_NIGHTLY: ${{ github.event_name == 'schedule' }}
|
||||||
|
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||||
run: |
|
run: |
|
||||||
if [ "$RUNNER_OS" == "macOS" ]; then
|
|
||||||
echo ">>> Detected macOS runner. Updating keychain for the app signing..."
|
|
||||||
echo "${{ secrets.KEYCHAIN }}" | base64 --decode > ~/Library/Keychains/apple-developer.keychain-db
|
|
||||||
security list-keychains -s ~/Library/Keychains/apple-developer.keychain-db
|
|
||||||
security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" ~/Library/Keychains/apple-developer.keychain-db
|
|
||||||
echo "<<< The keychain has been successfully updated."
|
|
||||||
fi
|
|
||||||
yarn --cwd ./electron/packager/
|
yarn --cwd ./electron/packager/
|
||||||
yarn --cwd ./electron/packager/ package
|
yarn --cwd ./electron/packager/ package
|
||||||
|
|
||||||
- name: Upload [GitHub Actions]
|
- name: Upload [GitHub Actions]
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ runner.os }}
|
name: build-artifacts
|
||||||
path: electron/build/dist/build-artifacts/
|
path: electron/build/dist/build-artifacts/
|
||||||
|
|
||||||
- name: Upload [S3]
|
publish:
|
||||||
if: env.IS_NIGHTLY == 'true'
|
needs: build
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download [GitHub Actions]
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: build-artifacts
|
||||||
|
path: build-artifacts
|
||||||
|
|
||||||
|
- name: Publish Nightly [S3]
|
||||||
uses: kittaakos/upload-s3-action@v0.0.1
|
uses: kittaakos/upload-s3-action@v0.0.1
|
||||||
with:
|
with:
|
||||||
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws_bucket: ${{ secrets.DOWNLOADS_BUCKET }}
|
aws_bucket: ${{ secrets.DOWNLOADS_BUCKET }}
|
||||||
source_dir: electron/build/dist/build-artifacts/
|
source_dir: build-artifacts/
|
||||||
destination_dir: arduino-pro-ide/nightly/
|
destination_dir: arduino-pro-ide/nightly/
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: build
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download [GitHub Actions]
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: build-artifacts
|
||||||
|
path: build-artifacts
|
||||||
|
|
||||||
|
- name: Create Release [GitHub]
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: ${{ github.ref }}
|
||||||
|
|
||||||
|
- name: Publish Release [GitHub]
|
||||||
|
uses: svenstaro/upload-release-action@v1-release
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: build-artifacts/*
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
file_glob: true
|
||||||
|
|
||||||
|
- name: Publish Release [S3]
|
||||||
|
uses: kittaakos/upload-s3-action@v0.0.1
|
||||||
|
with:
|
||||||
|
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws_bucket: ${{ secrets.DOWNLOADS_BUCKET }}
|
||||||
|
source_dir: build-artifacts/
|
||||||
|
destination_dir: arduino-pro-ide/
|
||||||
|
@ -102,6 +102,12 @@
|
|||||||
// Rebuild the extension with the copied `yarn.lock`. It is a must to use the same Theia versions. |
|
// Rebuild the extension with the copied `yarn.lock`. It is a must to use the same Theia versions. |
|
||||||
//-------------------------------------------------------------------------------------------------+
|
//-------------------------------------------------------------------------------------------------+
|
||||||
exec(`yarn --network-timeout 1000000 --cwd ${path('..', workingCopy)}`, `Building the ${productName} application`);
|
exec(`yarn --network-timeout 1000000 --cwd ${path('..', workingCopy)}`, `Building the ${productName} application`);
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
// Test the application. With this approach, we cannot publish test results to GH Actions but save 6-10 minutes per builds |
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
exec(`yarn --network-timeout 1000000 --cwd ${path('..', workingCopy)} test`, `Testing the ${productName} application`);
|
||||||
|
|
||||||
// Collect all unused dependencies by the backend. We have to remove them from the electron app.
|
// Collect all unused dependencies by the backend. We have to remove them from the electron app.
|
||||||
// The `bundle.js` already contains everything we need for the frontend.
|
// The `bundle.js` already contains everything we need for the frontend.
|
||||||
// We have to do it before changing the dependencies to `local-path`.
|
// We have to do it before changing the dependencies to `local-path`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user