Browse Source

Update workflows with new actions (#9)

pull/10/head
Vince Grassia 4 years ago committed by GitHub
parent
commit
31fee69133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/release.yml
  2. 8
      .github/workflows/update-links.yml
  3. 71
      .github/workflows/update-versions.yml

2
.github/workflows/release.yml

@ -29,7 +29,7 @@ jobs: @@ -29,7 +29,7 @@ jobs:
- name: Get Latest Self-Host Version
id: get-self-host
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
uses: bitwarden/gh-actions/get-release-version@664c8899c95490c65dac0df11519d24ed8419c85
with:
repository: bitwarden/self-host

8
.github/workflows/update-links.yml

@ -23,7 +23,7 @@ jobs: @@ -23,7 +23,7 @@ jobs:
secrets: "rebrandly-apikey"
- name: Update Bitwarden Script PowerShell Link
uses: bitwarden/gh-actions/update-rebrandly-link@c522a15810b70df8de25c2aa46e79a33d6a5ce12
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85
with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co"
@ -31,7 +31,7 @@ jobs: @@ -31,7 +31,7 @@ jobs:
destination: "https://github.org/bitwarden/self-host/releases/download/${{ env.GITHUB_REF }}/bitwarden.ps1"
- name: Update Run Script PowerShell Link
uses: bitwarden/gh-actions/update-rebrandly-link@c522a15810b70df8de25c2aa46e79a33d6a5ce12
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85
with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co"
@ -39,7 +39,7 @@ jobs: @@ -39,7 +39,7 @@ jobs:
destination: "https://github.org/bitwarden/self-host/releases/download/${{ env.GITHUB_REF }}/run.ps1"
- name: Update Bitwarden Script Shell Link
uses: bitwarden/gh-actions/update-rebrandly-link@c522a15810b70df8de25c2aa46e79a33d6a5ce12
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85
with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co"
@ -47,7 +47,7 @@ jobs: @@ -47,7 +47,7 @@ jobs:
destination: "https://github.org/bitwarden/self-host/releases/download/${{ env.GITHUB_REF }}/bitwarden.sh"
- name: Update Run Script Shell Link
uses: bitwarden/gh-actions/update-rebrandly-link@c522a15810b70df8de25c2aa46e79a33d6a5ce12
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85
with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co"

71
.github/workflows/update-versions.yml

@ -8,33 +8,90 @@ on: @@ -8,33 +8,90 @@ on:
jobs:
setup:
name: Setup
if: github.ref_name == 'master' || github.ref_name == 'rc' || github.ref_name == 'hotfix'
runs-on: ubuntu-20.04
outputs:
core_version: ${{ steps.get-core.outputs.version }}
core_version_update: ${{ steps.core-update.outputs.update }}
web_version: ${{ steps.get-web.outputs.version }}
web_version_update: ${{ steps.web-update.outputs.update }}
key_connector_version: ${{ steps.get-key-connector.outputs.version }}
key_connector_version_update: ${{ steps.key-connector-update.outputs.update }}
steps:
- name: Checkout Branch
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- name: Get Latest Core Version
id: get-core
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
uses: bitwarden/gh-actions/get-release-version@664c8899c95490c65dac0df11519d24ed8419c85
with:
repository: bitwarden/server
- name: Check if Core Version needs updating
id: core-update
env:
LATEST_CORE_VERSION: ${{ steps.get-core.outputs.version }}
run: |
CORE_VERSION=$(sed -r -n "s/COREVERSION=\"([0-9]+\.[0-9]+\.[0-9]+)\"/\1/p" bitwarden.sh)
echo "Core Version: $CORE_VERSION"
echo "Latest Core Version: $LATEST_CORE_VERSION"
if [ "$CORE_VERSION" != "$LATEST_CORE_VERSION" ]; then
echo "Needs Core update!"
echo "::set-output name=update::1"
else
echo "::set-output name=update::0"
fi
- name: Get Latest Web Version
id: get-web
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
uses: bitwarden/gh-actions/get-release-version@664c8899c95490c65dac0df11519d24ed8419c85
with:
repository: bitwarden/web
- name: Check if Web Version needs updating
id: web-update
env:
LATEST_WEB_VERSION: ${{ steps.get-web.outputs.version }}
run: |
WEB_VERSION=$(sed -r -n "s/WEBVERSION=\"([0-9]+\.[0-9]+\.[0-9]+)\"/\1/p" bitwarden.sh)
echo "Web Version: $WEB_VERSION"
echo "Latest Web Version: $LATEST_WEB_VERSION"
if [ "$WEB_VERSION" != "$LATEST_WEB_VERSION" ]; then
echo "Needs Web update!"
echo "::set-output name=update::1"
else
echo "::set-output name=update::0"
fi
- name: Get Latest Key Connector Version
id: get-key-connector
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
uses: bitwarden/gh-actions/get-release-version@664c8899c95490c65dac0df11519d24ed8419c85
with:
repository: bitwarden/key-connector
- name: Check if Key Connector Version needs updating
id: key-connector-update
env:
LATEST_KEY_CONNECTOR_VERSION: ${{ steps.get-key-connector.outputs.version }}
run: |
KEY_CONNECTOR_VERSION=$(sed -r -n "s/KEYCONNECTORVERSION=\"([0-9]+\.[0-9]+\.[0-9]+)\"/\1/p" bitwarden.sh)
echo "Key Connector Version: $KEY_CONNECTOR_VERSION"
echo "Latest Key Connector Version: $LATEST_KEY_CONNECTOR_VERSION"
if [ "$KEY_CONNECTOR_VERSION" != "$LATEST_KEY_CONNECTOR_VERSION" ]; then
echo "Needs Key Connector update!"
echo "::set-output name=update::1"
else
echo "::set-output name=update::0"
fi
update-versions:
name: "Create update_versions branch"
if: |
needs.setup.outputs.core_version_update == 1 ||
needs.setup.outputs.web_version_update == 1 ||
needs.setup.outputs.key_connector_version_update == 1
runs-on: ubuntu-20.04
needs: setup
steps:
@ -84,12 +141,12 @@ jobs: @@ -84,12 +141,12 @@ jobs:
- name: Create Update Versions PR
env:
PR_BRANCH: "update-versions"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
BASE_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: ${{ github.ref_name }}
TITLE: "Update core, web, and key-connector versions"
run: |
gh pr create --title "$TITLE" \
--base "$BASE" \
--base "$BASE_BRANCH" \
--head "$PR_BRANCH" \
--label "automated pr" \
--body "
@ -101,4 +158,4 @@ jobs: @@ -101,4 +158,4 @@ jobs:
- [X] Other
## Objective
Automated version updates to core, web, and key-connector versions in `bitwarden.sh` and `bitwarden.ps1`."
Automated version updates to core, web, and key-connector versions in bitwarden.sh and bitwarden.ps1."

Loading…
Cancel
Save