From 6720298e778b0ebd51debfa78c401455df3dea69 Mon Sep 17 00:00:00 2001 From: Carsten Meyer Date: Sun, 21 Mar 2021 15:56:46 +0100 Subject: [PATCH] removed origin workflows and new Docker build --- .../build-create-windows-store-on-release.yml | 53 ------- .../build-publish-to-aur-on-release.yml | 29 ---- .github/workflows/build-publish-to-docker.yml | 18 +++ .../build-publish-to-mac-store-on-release.yml | 62 -------- .../build-publish-to-snap-on-release.yml | 52 ------- .../build-update-web-app-on-release.yml | 53 ------- .github/workflows/build.yml | 147 ------------------ .github/workflows/stale.yml | 16 -- Dockerfile | 23 ++- 9 files changed, 27 insertions(+), 426 deletions(-) delete mode 100644 .github/workflows/build-create-windows-store-on-release.yml delete mode 100644 .github/workflows/build-publish-to-aur-on-release.yml create mode 100644 .github/workflows/build-publish-to-docker.yml delete mode 100644 .github/workflows/build-publish-to-mac-store-on-release.yml delete mode 100644 .github/workflows/build-publish-to-snap-on-release.yml delete mode 100644 .github/workflows/build-update-web-app-on-release.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/build-create-windows-store-on-release.yml b/.github/workflows/build-create-windows-store-on-release.yml deleted file mode 100644 index 2c60490688..0000000000 --- a/.github/workflows/build-create-windows-store-on-release.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Win Store File on Release -on: - release: - types: [published] - workflow_dispatch: - inputs: null - -jobs: - windows-store-artifact: - runs-on: windows-latest - - if: "!github.event.release.prerelease" - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - name: Load Electron Builder Windows Store Config - run: echo $WIN_STORE_ELECTRON_BUILDER_YML | base64 --decode > electron-builder.yaml - shell: bash - env: - WIN_STORE_ELECTRON_BUILDER_YML: ${{secrets.WIN_STORE_ELECTRON_BUILDER_YML}} - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - - - name: Build Frontend & Electron - run: yarn build - - - name: Build/Release Electron app - uses: samuelmeuli/action-electron-builder@v1 - with: - build_script_name: empty - release: false - github_token: ${{ secrets.github_token }} - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 - with: - name: WinStoreRelease - path: app-builds/*.appx diff --git a/.github/workflows/build-publish-to-aur-on-release.yml b/.github/workflows/build-publish-to-aur-on-release.yml deleted file mode 100644 index 2245d7e859..0000000000 --- a/.github/workflows/build-publish-to-aur-on-release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: AUR Release on Release -on: - release: - types: [published] - workflow_dispatch: - inputs: null - -jobs: - aur-release: - runs-on: ubuntu-latest - - if: "!github.event.release.prerelease" - - steps: - - uses: actions/checkout@v2 - - - run: PACKAGE_VERSION=$(cat ./package.json | grep version | head -1 | sed 's/[^0-9.]*//g') && echo "package_version=$PACKAGE_VERSION" >> $GITHUB_ENV - - run: sed "s/PACKAGE_VERSION/${package_version}/g" build/linux/PKGBUILD_template > build/linux/PKGBUILD - - - name: Publish AUR package - uses: KSXGitHub/github-actions-deploy-aur@v2.2.3 - with: - pkgname: superproductivity-bin - pkgbuild: build/linux/PKGBUILD - commit_username: ${{ secrets.AUR_USERNAME }} - commit_email: ${{ secrets.AUR_EMAIL }} - ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} - commit_message: Update AUR package - ssh_keyscan_types: rsa,dsa,ecdsa,ed25519 diff --git a/.github/workflows/build-publish-to-docker.yml b/.github/workflows/build-publish-to-docker.yml new file mode 100644 index 0000000000..1a0b505e58 --- /dev/null +++ b/.github/workflows/build-publish-to-docker.yml @@ -0,0 +1,18 @@ +name: Publish Docker image +on: + release: + types: [published] +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: meyca/super-productivity + tag_with_ref: true \ No newline at end of file diff --git a/.github/workflows/build-publish-to-mac-store-on-release.yml b/.github/workflows/build-publish-to-mac-store-on-release.yml deleted file mode 100644 index a7b913d699..0000000000 --- a/.github/workflows/build-publish-to-mac-store-on-release.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Mac Store Release on Release -on: - release: - types: [ published ] - workflow_dispatch: - inputs: null - -jobs: - mac-store-release: - runs-on: macos-latest - - if: "!github.event.release.prerelease" - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - run: 'echo "$PROVISION_PROFILE" | base64 --decode > embedded.provisionprofile' - shell: bash - env: - PROVISION_PROFILE: ${{secrets.mas_provision_profile}} - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - -# - name: Test E2E -# run: yarn e2e - - - name: Build Frontend & Electron - run: yarn build - - - uses: apple-actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.mac_certs }} - p12-password: ${{ secrets.mac_certs_password }} - - - name: Build Electron app - run: yarn dist:mac:mas:buildOnly - - - name: Validate App - run: ls app-builds; ls app-builds/mas; xcrun altool --validate-app -f app-builds/mas/Super*.pkg -u ${{secrets.APPLEID}} -p ${{secrets.APPLEIDPASS}} - env: - APPLEID: ${{secrets.APPLEID}} - APPLEIDPASS: ${{secrets.APPLEIDPASS}} - - - name: Push to Store - run: xcrun altool --upload-app -f app-builds/mas/Super*.pkg -u ${{secrets.APPLEID}} -p ${{secrets.APPLEIDPASS}} - env: - APPLEID: ${{secrets.APPLEID}} - APPLEIDPASS: ${{secrets.APPLEIDPASS}} diff --git a/.github/workflows/build-publish-to-snap-on-release.yml b/.github/workflows/build-publish-to-snap-on-release.yml deleted file mode 100644 index 59420f4018..0000000000 --- a/.github/workflows/build-publish-to-snap-on-release.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Win Store File on Release -on: - release: - types: [published] - workflow_dispatch: - inputs: null - -jobs: - snap-release: - runs-on: ubuntu-latest - - if: "!github.event.release.prerelease" - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - - - name: Test E2E - run: yarn e2e - - - name: Build Frontend & Electron - run: yarn build - - - name: Build/Release Electron app - uses: samuelmeuli/action-electron-builder@v1 - with: - build_script_name: empty - github_token: ${{ secrets.github_token }} - release: ${{ startsWith(github.ref, 'refs/tags/v') }} - - - name: Install Snapcraft - uses: samuelmeuli/action-snapcraft@v1 - with: - # Log in to Snap Store - snapcraft_token: ${{ secrets.snapcraft_token }} - - - run: snapcraft push app-builds/superProductivity*.snap --release stable diff --git a/.github/workflows/build-update-web-app-on-release.yml b/.github/workflows/build-update-web-app-on-release.yml deleted file mode 100644 index 662e7653b4..0000000000 --- a/.github/workflows/build-update-web-app-on-release.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Web App on Release -on: - release: - types: [published] - workflow_dispatch: - inputs: null - -jobs: - upload-to-app-super-productivity: - runs-on: ubuntu-latest - - if: "!github.event.release.prerelease" - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - name: Install Node.js, NPM and Yarn - uses: actions/setup-node@v1 - with: - node-version: 12 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - - - name: Test E2E - run: yarn e2e - - - name: Build Frontend & Electron - run: yarn buildFrontend:prodWeb - - - name: Deploy to Web Server - uses: easingthemes/ssh-deploy@v2.1.5 - env: - SSH_PRIVATE_KEY: ${{ secrets.WEB_SERVER_SSH_KEY }} - ARGS: '-rltgoDzvO --delete --exclude "news.json"' - SOURCE: "dist/" - REMOTE_HOST: ${{ secrets.WEB_REMOTE_HOST }} - REMOTE_USER: ${{ secrets.WEB_REMOTE_USER }} - TARGET: ${{ secrets.WEB_REMOTE_TARGET }} - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 74de6214a0..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,147 +0,0 @@ -name: Build All & Release -on: - push: - branches: [ master, test/git-actions ] - tags: - - v* - - -jobs: - linux-bin-and-snap-release: - runs-on: ubuntu-latest - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - - - name: Test E2E - run: yarn e2e - - - name: Build Frontend & Electron - run: yarn build - - - name: Build/Release Electron app - uses: samuelmeuli/action-electron-builder@v1 - with: - build_script_name: empty - github_token: ${{ secrets.github_token }} - release: ${{ startsWith(github.ref, 'refs/tags/v') }} - - - name: Install Snapcraft - uses: samuelmeuli/action-snapcraft@v1 - with: - # Log in to Snap Store - snapcraft_token: ${{ secrets.snapcraft_token }} - - # Release to edge if no tag and to candidate if tag - - run: snapcraft push app-builds/superProductivity*.snap --release edge - if: false == startsWith(github.ref, 'refs/tags/v') - - run: snapcraft push app-builds/superProductivity*.snap --release candidate - if: startsWith(github.ref, 'refs/tags/v') - - - mac-bin: - runs-on: macos-latest - if: startsWith(github.ref, 'refs/tags/v') - - steps: - - name: Echo is Release - run: echo "IS_RELEASE $IS_RELEASE, ${{ startsWith(github.ref, 'refs/tags/v') }}" - env: - IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }} - - - name: Check out Git repository - uses: actions/checkout@v1 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - run: 'echo "$PROVISION_PROFILE" | base64 --decode > embedded.provisionprofile' - shell: bash - env: - PROVISION_PROFILE: ${{secrets.dl_provision_profile}} - - - name: Prepare for app notarization - # Import Apple API key for app notarization on macOS - run: | - mkdir -p ~/private_keys/ - echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8 - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - - - name: Test E2E - run: yarn e2e - - - name: Build Frontend & Electron - run: yarn build - - - name: Build/Release Electron app - uses: samuelmeuli/action-electron-builder@v1 - with: - build_script_name: empty - github_token: ${{ secrets.github_token }} - mac_certs: ${{ secrets.mac_certs }} - mac_certs_password: ${{ secrets.mac_certs_password }} - release: ${{ startsWith(github.ref, 'refs/tags/v') }} - env: - # macOS notarization API key - API_KEY_ID: ${{ secrets.mac_api_key_id }} - API_KEY_ISSUER_ID: ${{ secrets.mac_api_key_issuer_id }} - - windows-bin: - runs-on: windows-latest - if: startsWith(github.ref, 'refs/tags/v') - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modulesTWO-${{ hashFiles('**/yarn.lock') }} - - - name: Install Yarn Packages - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - name: Lint - run: yarn lint - - - name: Test Unit - run: yarn test - - - name: Build Frontend & Electron - run: yarn build - - - name: Build/Release Electron app - uses: samuelmeuli/action-electron-builder@v1 - with: - build_script_name: empty - github_token: ${{ secrets.github_token }} - release: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 134c77e614..0000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - days-before-stale: 120 - days-before-close: 14 - stale-issue-message: 'This issue has not received any updates in 90 days. Please comment, if this still relevant!' - stale-pr-message: 'This PR has not received any updates in 90 days. Please comment, if this still relevant!' - days-before-pr-close: -1 diff --git a/Dockerfile b/Dockerfile index 1d5a81e303..d8fadfb4c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,40 +3,35 @@ ### build ### # base image -FROM node:12.2.0 as build +FROM node:12 as build # install chrome for protractor tests #RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - #RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' #RUN apt-get update && apt-get install -yq google-chrome-stable +# add app +COPY . /app + # set working directory WORKDIR /app # add `/app/node_modules/.bin` to $PATH ENV PATH /app/node_modules/.bin:$PATH -# install and cache app dependencies -COPY package.json /app/package.json -COPY ./tools /app/tools - RUN yarn -RUN yarn global add @angular/cli@8.0.2 +RUN yarn global add @angular/cli -# add app -COPY . /app - -# run tests -#RUN ng test --watch=false -#RUN ng e2e --port 4202 +# run linter +RUN yarn lint # generate build -RUN ng build --output-path=dist +RUN yarn buildFrontend:prodWeb ### serve ### # base image -FROM nginx:1.16.0-alpine +FROM nginx:1-alpine # environmental variables ENV PORT=80