diff --git a/.github/workflows/promote-charms.yaml b/.github/workflows/promote-charms.yaml index 246625df..db260ca8 100644 --- a/.github/workflows/promote-charms.yaml +++ b/.github/workflows/promote-charms.yaml @@ -32,14 +32,13 @@ jobs: - name: Determine Channel id: channel env: - BRANCH: ${{ github.ref }} + BRANCH: ${{ github.base_ref || github.ref }} run: | - # look for a branch matching the re \^release-1.\d+$\ - if [[ "${BRANCH}" =~ "^refs/head/release-1\.[0-9]+$" ]]; then - echo "track=${BRANCH:8}" >> "$GITHUB_OUTPUT" - else + BRANCH=${BRANCH#refs/heads/} # strip off refs/heads/ if it exists + if [[ "${BRANCH}" == "main" ]]; then echo "track=latest" >> "$GITHUB_OUTPUT" - fi + elif [[ "${BRANCH}" =~ "^release-[0-9]+\.[0-9]+$" ]]; then + echo "track=${BRANCH:8}" >> "$GITHUB_OUTPUT" echo "Promote from $track/${{github.event.inputs.origin-risk}} to $track/${{github.event.inputs.destination-risk}}" select-charms: runs-on: ubuntu-latest diff --git a/.github/workflows/publish-charms.yaml b/.github/workflows/publish-charms.yaml index 84eafd12..5d53bdac 100644 --- a/.github/workflows/publish-charms.yaml +++ b/.github/workflows/publish-charms.yaml @@ -17,15 +17,15 @@ jobs: - name: Determine Channel id: channel env: - BRANCH: ${{ github.ref }} + BRANCH: ${{ github.base_ref || github.ref }} run: | - # look for a branch matching the re \^release-1.\d+$\ - if [[ "${BRANCH}" =~ "^refs/head/release-1\.[0-9]+$" ]]; then - echo "track=${BRANCH:8}" >> "$GITHUB_OUTPUT" - echo "risk=beta" >> "$GITHUB_OUTPUT" - else + BRANCH=${BRANCH#refs/heads/} # strip off refs/heads/ if it exists + if [[ "${BRANCH}" == "main" ]]; then echo "track=latest" >> "$GITHUB_OUTPUT" echo "risk=edge" >> "$GITHUB_OUTPUT" + elif [[ "${BRANCH}" =~ "^release-[0-9]+\.[0-9]+$" ]]; then + echo "track=${BRANCH:8}" >> "$GITHUB_OUTPUT" + echo "risk=beta" >> "$GITHUB_OUTPUT" fi publish-to-edge: needs: [configure-channel] diff --git a/docs/releases/stable/index.md b/docs/releases/stable/index.md index a4b3c3da..416304df 100644 --- a/docs/releases/stable/index.md +++ b/docs/releases/stable/index.md @@ -99,7 +99,7 @@ create python environments locally to help freeze the requirements.txt Choose the environment based build-on base in `charms/worker/k8s/charmcraft.yaml` -In the following example, building on focal yields packages for py38. +In the following example, building on focal yields packages for python 3.8. ```yaml - build-on: - name: ubuntu