diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c32043e..3e3a489 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/update-links.yml b/.github/workflows/update-links.yml index 9a370fc..75addf7 100644 --- a/.github/workflows/update-links.yml +++ b/.github/workflows/update-links.yml @@ -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: 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: 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: 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" diff --git a/.github/workflows/update-versions.yml b/.github/workflows/update-versions.yml index ba97f64..9efe2cc 100644 --- a/.github/workflows/update-versions.yml +++ b/.github/workflows/update-versions.yml @@ -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: - 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: - [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."