Skip to content

Update nuget minor #148

Update nuget minor

Update nuget minor #148

Workflow file for this run

---
name: Build
on:
push:
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
jobs:
cloc:
name: CLOC
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install cloc
run: sudo apt update && sudo apt install cloc -y
- name: Print lines of code
run: |
cloc --include-lang \
C#,SQL,Razor,"Bourne Shell",PowerShell,HTML,CSS,Sass,JavaScript,TypeScript \
--vcs git
build-artifacts:
name: Build artifacts
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Print environment
run: |
whoami
dotnet --info
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
- name: Restore/Clean service
working-directory: ./src/KeyConnector
run: |
echo "Restore"
dotnet restore
echo "Clean"
dotnet clean -c "Release" -o obj/build-output/publish
- name: Publish service
working-directory: ./src/KeyConnector
run: |
echo "Publish"
dotnet publish -c "Release" -o obj/build-output/publish
cd obj/build-output/publish
zip -r KeyConnector.zip .
mv KeyConnector.zip ../../../
pwd
ls -atlh ../../../
- name: Upload service artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: KeyConnector.zip
path: ./src/KeyConnector/KeyConnector.zip
if-no-files-found: error
build-docker:
name: Build Docker images
runs-on: ubuntu-20.04
needs: build-artifacts
env:
_SERVICE_NAME: key-connector
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Setup DCT
id: setup-dct
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc'
uses: bitwarden/gh-actions/setup-docker-trust@33f5410f5faac36cd8c32359fff9d2306119979a
with:
azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
azure-keyvault-name: "bitwarden-ci"
- name: Get build artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: KeyConnector.zip
- name: Setup build artifact
run: |
mkdir -p ./src/KeyConnector/obj/build-output/publish
unzip KeyConnector.zip \
-d ./src/KeyConnector/obj/build-output/publish
- name: Build Docker images
run: |
docker build -t ${{ env._SERVICE_NAME }} \
./src/KeyConnector
- name: Tag and Push RC to Docker Hub
if: (github.ref == 'refs/heads/rc')
env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
run: |
docker tag ${{ env._SERVICE_NAME }} \
bitwarden/${{ env._SERVICE_NAME }}:rc
docker push bitwarden/${{ env._SERVICE_NAME }}:rc
- name: Tag and Push Hotfix to Docker Hub
if: (github.ref == 'refs/heads/hotfix-rc')
env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
run: |
docker tag ${{ env._SERVICE_NAME }} \
bitwarden/${{ env._SERVICE_NAME }}:hotfix
docker push bitwarden/${{ env._SERVICE_NAME }}:hotfix
- name: Tag and Push Dev to Docker Hub
if: (github.ref == 'refs/heads/master')
env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
run: |
docker tag ${{ env._SERVICE_NAME }} \
bitwarden/${{ env._SERVICE_NAME }}:dev
docker push bitwarden/${{ env._SERVICE_NAME }}:dev
- name: Log out of Docker and disable Docker Notary
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc'
run: |
docker logout
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV