Fix GitHub Workflow to Build and Publish Image #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: semver tag | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
semver-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Git | |
run: | | |
git config user.name "crusoe-cloud" | |
git config user.email "[email protected]" | |
- name: Load versions from text file | |
run: | | |
source versions.env | |
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_ENV | |
echo "MINOR_VERSION=${MINOR_VERSION}" >> $GITHUB_ENV | |
- name: Calculate and set new version | |
run: | | |
chmod +x ./scripts/tag_semver.sh | |
./scripts/tag_semver.sh $MAJOR_VERSION $MINOR_VERSION "" | |
shell: bash | |
- name: Read version and push tag | |
run: | | |
source variables.env | |
echo "Calculated version: $RELEASE_VERSION" | |
source variables.env | |
git tag $RELEASE_VERSION | |
git push origin $RELEASE_VERSION |