Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update set-output to environment variables #73

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v3
- name: Authenticate with Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCR_KEY }}
- name: Setup Google Cloud SDK
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
token: ${{ secrets.BOT_TOKEN }}
- name: Authenticate with Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCR_KEY }}
- name: Setup Google Cloud SDK
Expand All @@ -54,20 +54,20 @@ jobs:
run: |
PR=$(echo "$GITHUB_REF" | awk -F / '{print $3}')
echo "$PR"
echo "pr_number=pr-$PR" >> $GITHUB_OUTPUT
echo "pr_number=pr-$PR" >> $GITHUB_ENV

- name: Publish dev Chart
if: github.ref != 'refs/heads/main'
run: |
mv $IMAGE-${{ env.HELM_VERSION }}.tgz $IMAGE-${{ steps.tag.outputs.pr_number }}.tgz
mv $IMAGE-${{ env.HELM_VERSION }}.tgz $IMAGE-${{ env.pr_number }}.tgz
gsutil cp $IMAGE-*.tgz gs://$ARTIFACT_BUCKET/$IMAGE/

- name: Set current tag
if: github.ref != 'refs/heads/main'
id: vars
run: |
git fetch --tags
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- name: update versions
if: github.ref != 'refs/heads/main'
Expand All @@ -77,19 +77,19 @@ jobs:
auto patch increment
shell: bash
run: |
echo "Current git version: ${{ steps.vars.outputs.tag }}"
echo "Current git version: ${{ env.tag }}"
export APP_VERSION=$(grep -E "appVersion:\s+" $CHART_DIRECTORY/Chart.yaml | cut -d" " -f2 | sed -r 's/"//g')
export CHART_VERSION=$(grep -E "version:\s+" $CHART_DIRECTORY/Chart.yaml | cut -d" " -f2 | sed -r 's/"//g')
echo "appVersion: $APP_VERSION"
echo "chartVersion: $CHART_VERSION"
if [ ${{ steps.vars.outputs.tag }} = $APP_VERSION ]; then
if [ ${{ env.tag }} = $APP_VERSION ]; then
echo "versions match, incrementing patch"
OLD_PATCH=$(echo ${{ steps.vars.outputs.tag }} | cut -d '.' -f3)
OLD_PATCH=$(echo ${{ env.tag }} | cut -d '.' -f3)
echo "OLD patch: $OLD_PATCH"
NEW_PATCH=$(($OLD_PATCH + 1))
echo "New patch version: $NEW_PATCH"
NEW_APP_VERSION="appVersion: $(echo ${{ steps.vars.outputs.tag }} | sed -e "s/[0-9]\{1,3\}/$NEW_PATCH/3")"
NEW_CHART_VERSION="version: $(echo ${{ steps.vars.outputs.tag }} | sed -e "s/[0-9]\{1,3\}/$NEW_PATCH/3")"
NEW_APP_VERSION="appVersion: $(echo ${{ env.tag }} | sed -e "s/[0-9]\{1,3\}/$NEW_PATCH/3")"
NEW_CHART_VERSION="version: $(echo ${{ env.tag }} | sed -e "s/[0-9]\{1,3\}/$NEW_PATCH/3")"
sed -i -e "s/appVersion: .*/$NEW_APP_VERSION/g" $CHART_DIRECTORY/Chart.yaml
sed -i -e "s/version: .*/$NEW_CHART_VERSION/g" $CHART_DIRECTORY/Chart.yaml
git config user.name "ras-rm-pr-bot"
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
id: release
shell: bash
run: |
echo "version=$(grep -E "appVersion:\s+" $CHART_DIRECTORY/Chart.yaml | cut -d" " -f2 | sed -r 's/"//g')" >> $GITHUB_OUTPUT
echo "version=$(grep -E "appVersion:\s+" $CHART_DIRECTORY/Chart.yaml | cut -d" " -f2 | sed -r 's/"//g')" >> $GITHUB_ENV

- name: Publish Charts
if: github.ref == 'refs/heads/main'
Expand All @@ -140,11 +140,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release.outputs.version }}
release_name: ${{ steps.release.outputs.version }}
tag_name: ${{ env.version }}
release_name: ${{ env.version }}
body: |
Automated release
${{ steps.release.outputs.version }}
${{ env.version }}
draft: false
prerelease: false

Expand Down
4 changes: 2 additions & 2 deletions _infra/helm/uaa/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.1.10
version: 2.1.11

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 2.1.10
appVersion: 2.1.11
Loading