Skip to content

Commit

Permalink
Versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
withinfocus committed Sep 14, 2023
1 parent bd9816e commit 89ad721
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ defaults:
shell: bash

jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
package_version: ${{ steps.retrieve-version.outputs.package_version }}
steps:
- name: Checkout repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Get Package Version
id: retrieve-version
run: |
VERSION=$(grep -o '^version = ".*"' crates/bws/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
echo "package_version=$VERSION" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-22.04
strategy:
Expand Down Expand Up @@ -54,7 +69,9 @@ jobs:

combine:
runs-on: ubuntu-22.04
needs: build
needs:
- setup
- build
steps:
- name: Checkout repo (PR)
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
Expand Down Expand Up @@ -119,5 +136,6 @@ jobs:
arguments: sdk:publish
build-root-directory: languages/kotlin
env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
GITHUB_ACTOR: "bitwarden-devops-bot"
GITHUB_TOKEN: ${{ steps.retrieve-bot-secrets.outputs.github-pat-bitwarden-devops-bot-packages-scope }}
4 changes: 2 additions & 2 deletions languages/kotlin/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ publishing {
def details = versionDetails()

if (details.branchName == null) {
version = "master-SNAPSHOT"
version = System.getenv("_PACKAGE_VERSION")
} else {
version "${details.branchName.replaceAll('/', '-')}-SNAPSHOT"
version "${System.getenv("_PACKAGE_VERSION")}-${details.branchName.replaceAll('/', '-')}-SNAPSHOT"
}

afterEvaluate {
Expand Down

0 comments on commit 89ad721

Please sign in to comment.