1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

limit when steps run

This commit is contained in:
Kyle Spearrin 2020-09-25 11:48:15 -04:00
parent 989c135c4a
commit 694237536b

View File

@ -56,14 +56,14 @@ jobs:
run: ./.github/scripts/load-version.ps1
shell: pwsh
- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
~/.npm
~/.electron-gyp
node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
# - name: Cache node_modules
# uses: actions/cache@v2
# with:
# path: |
# ~/.npm
# ~/.electron-gyp
# node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Node dependencies
run: npm install
@ -131,14 +131,14 @@ jobs:
run: ./.github/scripts/load-version.ps1
shell: pwsh
- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
~/.npm
~/.electron-gyp
node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
# - name: Cache node_modules
# uses: actions/cache@v2
# with:
# path: |
# ~/.npm
# ~/.electron-gyp
# node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Node dependencies
run: npm install
@ -186,9 +186,6 @@ jobs:
- name: Set Node options
run: echo "::set-env name=NODE_OPTIONS::--max_old_space_size=4096"
- name: Set Debug
run: echo "::set-env name=DEBUG::electron-builder electron-osx-sign*"
- name: Print environment
run: |
node --version
@ -225,7 +222,6 @@ jobs:
shell: pwsh
- name: Increment version
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
run: ./.github/scripts/macos/increment-version.ps1
shell: pwsh
@ -233,14 +229,14 @@ jobs:
run: ./.github/scripts/load-version.ps1
shell: pwsh
- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
~/.npm
~/.electron-gyp
node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
# - name: Cache node_modules
# uses: actions/cache@v2
# with:
# path: |
# ~/.npm
# ~/.electron-gyp
# node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Node dependencies
run: npm install
@ -249,58 +245,73 @@ jobs:
run: npm run lint
- name: Create Safari directory
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
shell: pwsh
run: New-Item ./dist-safari -ItemType Directory -ea 0
- name: Checkout browser extension
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
uses: actions/checkout@v2
with:
repository: 'bitwarden/browser'
path: 'dist-safari/browser'
- name: Build Safari extension
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
shell: pwsh
run: ./scripts/safari-build.ps1 -skipcheckout -skipoutcopy
# - name: Load Safari extension for .dmg
# shell: pwsh
# run: ./scripts/safari-build.ps1 -copyonly
#
# - name: Build for .dmg
# run: npm run dist:mac
# env:
# APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
#
# - name: Upload .zip artifact
# uses: actions/upload-artifact@v2
# with:
# name: Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip
# path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip
#
# - name: Upload .dmg artifact
# uses: actions/upload-artifact@v2
# with:
# name: Bitwarden-${{ env.PACKAGE_VERSION }}.dmg
# path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}.dmg
- name: Load Safari extension for .dmg
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
shell: pwsh
run: ./scripts/safari-build.ps1 -copyonly
- name: Build
if: github.ref != 'refs/heads/master' && github.event_name != 'release'
run: npm run build
- name: Build for .dmg
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
run: npm run dist:mac
env:
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Upload .zip artifact
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
uses: actions/upload-artifact@v2
with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip
- name: Upload .dmg artifact
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
uses: actions/upload-artifact@v2
with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}.dmg
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}.dmg
- name: Load Safari extension for App Store
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
shell: pwsh
run: ./scripts/safari-build.ps1 -mas -copyonly
- name: Build for App Store
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
run: npm run dist:mac:mas
env:
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Upload .pkg artifact
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
uses: actions/upload-artifact@v2
with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}.pkg
path: ./dist/mas/Bitwarden-${{ env.PACKAGE_VERSION }}.pkg
- name: Deploy to App Store
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
run: npm run upload:mas
env:
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}