Add release assets (#1218)
* adding new build artifacts * fixing some version issues * fixing syntax error * fixing asset names * updating the release workflow to release the new build assets
This commit is contained in:
parent
2e4c6b7828
commit
7b21e380cb
|
@ -29,8 +29,230 @@ jobs:
|
||||||
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
||||||
|
|
||||||
|
|
||||||
|
setup:
|
||||||
|
name: Setup
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.value }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Get GitHub sha as version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=value::${GITHUB_SHA:0:7}"
|
||||||
|
|
||||||
|
|
||||||
|
build-oss-selfhost:
|
||||||
|
name: Build OSS zip
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_VERSION: ${{ needs.setup.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
id: npm-cache
|
||||||
|
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
||||||
|
with:
|
||||||
|
path: '~/.npm'
|
||||||
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
|
||||||
|
- name: Print environment
|
||||||
|
run: |
|
||||||
|
whoami
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
gulp --version
|
||||||
|
docker --version
|
||||||
|
echo "GitHub ref: $GITHUB_REF"
|
||||||
|
echo "GitHub event: $GITHUB_EVENT"
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build OSS selfhost
|
||||||
|
run: |
|
||||||
|
npm run dist:oss:selfhost
|
||||||
|
zip -r web-$_VERSION-selfhosted-open-source.zip build
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
||||||
|
with:
|
||||||
|
name: web-${{ env._VERSION }}-selfhosted-open-source.zip
|
||||||
|
path: ./web-${{ env._VERSION }}-selfhosted-open-source.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|
||||||
|
build-cloud:
|
||||||
|
name: Build Cloud zip
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_VERSION: ${{ needs.setup.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
id: npm-cache
|
||||||
|
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
||||||
|
with:
|
||||||
|
path: '~/.npm'
|
||||||
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
|
||||||
|
- name: Print environment
|
||||||
|
run: |
|
||||||
|
whoami
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
gulp --version
|
||||||
|
docker --version
|
||||||
|
echo "GitHub ref: $GITHUB_REF"
|
||||||
|
echo "GitHub event: $GITHUB_EVENT"
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build Cloud
|
||||||
|
run: |
|
||||||
|
npm run dist:bit:cloud
|
||||||
|
zip -r web-$_VERSION-cloud-COMMERCIAL.zip build
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
||||||
|
with:
|
||||||
|
name: web-${{ env._VERSION }}-cloud-COMMERCIAL.zip
|
||||||
|
path: ./web-${{ env._VERSION }}-cloud-COMMERCIAL.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|
||||||
|
build-commercial-selfhost:
|
||||||
|
name: Build SelfHost Docker image
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_VERSION: ${{ needs.setup.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
id: npm-cache
|
||||||
|
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
||||||
|
with:
|
||||||
|
path: '~/.npm'
|
||||||
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
|
||||||
|
- name: Print environment
|
||||||
|
run: |
|
||||||
|
whoami
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
gulp --version
|
||||||
|
docker --version
|
||||||
|
echo "GitHub ref: $GITHUB_REF"
|
||||||
|
echo "GitHub event: $GITHUB_EVENT"
|
||||||
|
|
||||||
|
- name: Setup DCT
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
|
id: setup-dct
|
||||||
|
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
|
||||||
|
with:
|
||||||
|
azure-creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||||
|
azure-keyvault-name: "bitwarden-prod-kv"
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Restore
|
||||||
|
run: dotnet tool restore
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
echo -e "# Building Web\n"
|
||||||
|
echo "Building app"
|
||||||
|
echo "npm version $(npm --version)"
|
||||||
|
|
||||||
|
npm run dist:bit:selfhost
|
||||||
|
zip -r web-$_VERSION-selfhosted-COMMERCIAL.zip build
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
||||||
|
with:
|
||||||
|
name: web-${{ env._VERSION }}-selfhosted-COMMERCIAL.zip
|
||||||
|
path: ./web-${{ env._VERSION }}-selfhosted-COMMERCIAL.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
echo -e "\nBuilding Docker image"
|
||||||
|
docker --version
|
||||||
|
docker build -t bitwarden/web .
|
||||||
|
|
||||||
|
- name: Tag rc branch
|
||||||
|
if: github.ref == 'refs/heads/rc'
|
||||||
|
run: docker tag bitwarden/web bitwarden/web:rc
|
||||||
|
|
||||||
|
- name: Tag dev
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: docker tag bitwarden/web bitwarden/web:dev
|
||||||
|
|
||||||
|
- name: List Docker images
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
|
run: docker images
|
||||||
|
|
||||||
|
- name: Push rc images
|
||||||
|
if: github.ref == 'refs/heads/rc'
|
||||||
|
run: docker push bitwarden/web:rc
|
||||||
|
env:
|
||||||
|
DOCKER_CONTENT_TRUST: 1
|
||||||
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
|
||||||
|
|
||||||
|
- name: Push dev images
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: docker push bitwarden/web:dev
|
||||||
|
env:
|
||||||
|
DOCKER_CONTENT_TRUST: 1
|
||||||
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
|
||||||
|
|
||||||
|
- name: Log out of Docker
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
|
run: docker logout
|
||||||
|
|
||||||
|
|
||||||
build-qa:
|
build-qa:
|
||||||
name: Build Docker images for testing
|
name: Build Docker images for QA environment
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
|
@ -129,149 +351,6 @@ jobs:
|
||||||
run: docker logout
|
run: docker logout
|
||||||
|
|
||||||
|
|
||||||
build-cloud:
|
|
||||||
name: Build Cloud zip
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
|
||||||
with:
|
|
||||||
node-version: '14'
|
|
||||||
|
|
||||||
- name: Update NPM
|
|
||||||
run: |
|
|
||||||
npm install -g npm@7
|
|
||||||
|
|
||||||
- name: Cache npm
|
|
||||||
id: npm-cache
|
|
||||||
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
|
||||||
with:
|
|
||||||
path: '~/.npm'
|
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
|
|
||||||
- name: Print environment
|
|
||||||
run: |
|
|
||||||
whoami
|
|
||||||
node --version
|
|
||||||
npm --version
|
|
||||||
gulp --version
|
|
||||||
docker --version
|
|
||||||
echo "GitHub ref: $GITHUB_REF"
|
|
||||||
echo "GitHub event: $GITHUB_EVENT"
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build Cloud
|
|
||||||
run: |
|
|
||||||
npm run dist:bit:cloud
|
|
||||||
zip -r prod-build-artifact.zip build
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
|
||||||
with:
|
|
||||||
name: prod-build-artifact.zip
|
|
||||||
path: ./prod-build-artifact.zip
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
build-selfhost:
|
|
||||||
name: Build SelfHost Docker image
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
|
||||||
with:
|
|
||||||
node-version: '14'
|
|
||||||
|
|
||||||
- name: Update NPM
|
|
||||||
run: |
|
|
||||||
npm install -g npm@7
|
|
||||||
|
|
||||||
- name: Cache npm
|
|
||||||
id: npm-cache
|
|
||||||
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
|
||||||
with:
|
|
||||||
path: '~/.npm'
|
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
|
|
||||||
- name: Print environment
|
|
||||||
run: |
|
|
||||||
whoami
|
|
||||||
node --version
|
|
||||||
npm --version
|
|
||||||
gulp --version
|
|
||||||
docker --version
|
|
||||||
echo "GitHub ref: $GITHUB_REF"
|
|
||||||
echo "GitHub event: $GITHUB_EVENT"
|
|
||||||
|
|
||||||
- name: Setup DCT
|
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
|
||||||
id: setup-dct
|
|
||||||
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
|
|
||||||
with:
|
|
||||||
azure-creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
|
||||||
azure-keyvault-name: "bitwarden-prod-kv"
|
|
||||||
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
||||||
|
|
||||||
- name: Restore
|
|
||||||
run: dotnet tool restore
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
echo -e "# Building Web\n"
|
|
||||||
echo "Building app"
|
|
||||||
echo "npm version $(npm --version)"
|
|
||||||
VERSION=$( jq -r ".version" package.json)
|
|
||||||
jq --arg version "$VERSION - ${GITHUB_SHA:0:7}" '.version = $version' package.json > package.json.tmp
|
|
||||||
mv package.json.tmp package.json
|
|
||||||
|
|
||||||
npm run dist:bit:selfhost
|
|
||||||
|
|
||||||
echo "{\"commit_hash\": \"$GITHUB_SHA\", \"ref\": \"$GITHUB_REF\"}" | jq . > build/info.json
|
|
||||||
|
|
||||||
echo -e "\nBuilding Docker image"
|
|
||||||
docker --version
|
|
||||||
docker build -t bitwarden/web .
|
|
||||||
|
|
||||||
- name: Tag rc branch
|
|
||||||
if: github.ref == 'refs/heads/rc'
|
|
||||||
run: docker tag bitwarden/web bitwarden/web:rc
|
|
||||||
|
|
||||||
- name: Tag dev
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
run: docker tag bitwarden/web bitwarden/web:dev
|
|
||||||
|
|
||||||
- name: List Docker images
|
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
|
||||||
run: docker images
|
|
||||||
|
|
||||||
- name: Push rc images
|
|
||||||
if: github.ref == 'refs/heads/rc'
|
|
||||||
run: docker push bitwarden/web:rc
|
|
||||||
env:
|
|
||||||
DOCKER_CONTENT_TRUST: 1
|
|
||||||
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
|
|
||||||
|
|
||||||
- name: Push dev images
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
run: docker push bitwarden/web:dev
|
|
||||||
env:
|
|
||||||
DOCKER_CONTENT_TRUST: 1
|
|
||||||
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
|
|
||||||
|
|
||||||
- name: Log out of Docker
|
|
||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
|
||||||
run: docker logout
|
|
||||||
|
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
name: Test code on Windows
|
name: Test code on Windows
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
@ -318,6 +397,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: NPM install
|
- name: NPM install
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
|
|
@ -117,17 +117,17 @@ jobs:
|
||||||
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
||||||
git config --global url."https://".insteadOf ssh://
|
git config --global url."https://".insteadOf ssh://
|
||||||
|
|
||||||
- name: Download latest RC Production build
|
- name: Download latest cloud asset
|
||||||
uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
|
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
||||||
with:
|
with:
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
branch: rc
|
branch: rc
|
||||||
name: prod-build-artifact.zip
|
artifacts: web-*-cloud-COMMERCIAL.zip
|
||||||
|
|
||||||
# This should result in a build directory in the current working directory
|
# This should result in a build directory in the current working directory
|
||||||
- name: Unzip build asset
|
- name: Unzip build asset
|
||||||
run: unzip prod-build-artifact.zip
|
run: unzip web-*-cloud-COMMERCIAL.zip
|
||||||
|
|
||||||
- name: Deploy GitHub Pages
|
- name: Deploy GitHub Pages
|
||||||
uses: crazy-max/ghaction-github-pages@db4476a01402e1a7ce05f41832040eef16d14925 # v2.5.0
|
uses: crazy-max/ghaction-github-pages@db4476a01402e1a7ce05f41832040eef16d14925 # v2.5.0
|
||||||
|
@ -158,20 +158,27 @@ jobs:
|
||||||
- self-host
|
- self-host
|
||||||
- ghpages-deploy
|
- ghpages-deploy
|
||||||
steps:
|
steps:
|
||||||
- name: Download latest RC Production build
|
- name: Download latest build artifacts
|
||||||
uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
|
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
||||||
with:
|
with:
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
branch: rc
|
branch: rc
|
||||||
name: prod-build-artifact.zip
|
artifacts: "web-*-selfhosted-COMMERCIAL.zip,
|
||||||
|
web-*-selfhosted-open-source.zip"
|
||||||
|
|
||||||
|
- name: Rename assets
|
||||||
|
run: |
|
||||||
|
mv web-*-selfhosted-COMMERCIAL.zip web-${{ needs.setup.outputs.release_version }}-selfhosted-COMMERCIAL.zip
|
||||||
|
mv web-*-selfhosted-open-source.zip web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09
|
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09
|
||||||
with:
|
with:
|
||||||
artifacts: prod-build-artifact.zip
|
name: "Version ${{ needs.setup.outputs.release_version }}"
|
||||||
commit: ${{ github.sha }}
|
commit: ${{ github.sha }}
|
||||||
tag: "${{ needs.setup.outputs.tag_version }}"
|
tag: "${{ needs.setup.outputs.tag_version }}"
|
||||||
name: "Version ${{ needs.setup.outputs.release_version }}"
|
|
||||||
body: "<insert release notes here>"
|
body: "<insert release notes here>"
|
||||||
|
artifacts: "web-${{ needs.setup.outputs.release_version }}-selfhosted-COMMERCIAL.zip,
|
||||||
|
web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
Loading…
Reference in New Issue