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

new-release-process #136

Merged
merged 5 commits into from
Nov 14, 2023
Merged
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
66 changes: 39 additions & 27 deletions .github/workflows/internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,54 @@ jobs:
persist-credentials: true
fetch-depth: 0
token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }}
# Until we can leverage our self hosted runners, we have to install
- name: download_auto
run: |
curl -vkL -o - https://github.com/intuit/auto/releases/download/v10.46.0/auto-linux.gz | gunzip > /usr/local/bin/auto && \
chmod +x /usr/local/bin/auto; \
- uses: actions/setup-node@v3
with:
node-version: 18.15.0
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- run: npm ci
- name: get_version
id: get_version
env:
GITHUB_TOKEN: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }}
- name: pr_labels
id: pr_labels
uses: joerick/[email protected]
- name: package_json
id: package_json
run: |
echo "version=$(jq -r .version < package.json)" >> $GITHUB_OUTPUT
- name: semver_versions
id: semver_versions
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.package_json.outputs.version }}
- name: patch_version
run: |
echo "NEW_VERSION=${{ steps.semver_versions.outputs.patch }}" >> $GITHUB_ENV
- name: minor_version
if: contains(steps.pr_labels.outputs.labels, 'minor')
run: |
auto info
VERSION=auto version
echo "version will be $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "major_version=$(echo $VERSION | cut -d '.' -f 1)" >> $GITHUB_OUTPUT
echo "NEW_VERSION=${{ steps.semver_versions.outputs.minor }}" >> $GITHUB_ENV
- name: major_version
if: contains(steps.pr_labels.outputs.labels, 'major')
run: |
echo "NEW_VERSION=${{ steps.semver_versions.outputs.major }}" >> $GITHUB_ENV
- name: echo_version_info
run: |
echo "current version is ${{ steps.package_json.outputs.version }}"
echo "new version will be ${{ env.NEW_VERSION }}"
- name: update_composite_tags
run: |
echo "update-composite-tags with ${{ steps.get_version.outputs.version }}"
npm run update-composite-tags ${{ steps.get_version.outputs.version }}
- name: version_artifact
uses: ./.github/actions/version_artifact
with:
github_token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }}
npm run update-composite-tags ${{ env.NEW_VERSION }}
- name: update_package_json_version
run: |
echo "`jq '.version="${{ env.NEW_VERSION }}"' package.json`" > package.json
- name: new_tags
run: |
git tag v${{ env.NEW_VERSION }}
git push --follow-tags --set-upstream origin main
# We reset the major tag so workflow consumers automatically receive these changes
- name: update_major_tag
# If the versions are equal, then we know this is a new major version
if: ${{ steps.get_version.outputs.version != steps.get_version.outputs.major_version }}
- name: reset_major_tag
if: ${{ env.NEW_VERSION != steps.semver_versions.outputs.major }}
run: |
echo "update_major_tag with ${{ steps.get_version.outputs.major_version }}"
git tag -f ${{ steps.get_version.outputs.major_version }}
git push origin ${{ steps.get_version.outputs.major_version }} --force
git tag -f v${{ env.NEW_VERSION }}
git push origin v${{ env.NEW_VERSION }} --force