1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-30 08:10:34 +01:00
bitwarden-browser/.github/workflows/deploy.yml

122 lines
3.3 KiB
YAML

name: Deploy
on:
release:
types:
- prereleased
workflow_dispatch:
inputs:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.get_pkg_version.outputs.package_version }}
tag_version: ${{ steps.get_pkg_version.outputs.tag_version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Get package version
id: get_pkg_version
run: |
TAG_VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3)
PKG_VERSION=${TAG_VERSION:1}
echo "::set-output name=package_version::$PKG_VERSION"
echo "::set-output name=tag_version::$TAG_VERSION"
snap:
name: Publish Snap
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
#with:
# snapcraft_token: ${{ secrets.SNAP_TOKEN }}
- name: Get snap release asset
uses: dsaltares/fetch-gh-release-asset@0.0.5
with:
version: tags/${{ env.TAG_VERSION }}
file: bw_${{ env.PKG_VERSION }}_amd64.snap
env:
PKG_VERSION: ${{ needs.setup.outputs.package_version }}
TAG_VERSION: ${{ needs.setup.outputs.tag_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: move assets
run: |
echo "Hopefully this is temporary until release 0.0.6 of the fetch-gh-release-asset is released"
mkdir dist
mv bw_${{ env.PKG_VERSION }}_amd64.snap -t dist
- name: test
run: ls -alht dist
#- name: Publish Snap & logout
# run: |
# snapcraft push ./dist/bw_${{ env.PACKAGE_VERSION }}_amd64.snap --release stable
# snapcraft logout
choco:
name: Publish Choco
runs-on: windows-latest
needs: setup
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Chocolatey
run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
env:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
- name: Get choco release asset
uses: dsaltares/fetch-gh-release-asset@0.0.5
with:
version: tags/${{ env.TAG_VERSION }}
file: bitwarden.${{ env.PKG_VERSION }}.nupkg
env:
PKG_VERSION: ${{ needs.setup.outputs.package_version }}
TAG_VERSION: ${{ needs.setup.outputs.tag_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push to Chocolatey
shell: pwsh
run: |
# In place of ./scripts/choco-update.ps1
New-Item -ItemType directory -Path ./dist
Move-Item -Path bitwarden.${{ env.PKG_VERSION }}.nupkg -Destination ./dist
cd ./dist
#choco push
- name: test
run: ls -atlh dist
npm:
name: Publish NPM
if: false
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup NPM
shell: pwsh
run: |
"//registry.npmjs.org/:_authToken=${env:NPM_TOKEN}" | Out-File ".npmrc" -Encoding UTF8
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish NPM
run: npm run publish:npm