refactor: Split last_semantic_version_tag() function into 2 general p… #64
Workflow file for this run
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
on: | |
push: | |
branches-ignore: | |
- 'main' | |
paths-ignore: | |
- '**/README.md' | |
- '**/LICENSE' | |
name: Development | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Formatter | |
run: cargo fmt --all -- --check | |
- name: Lint | |
run: cargo clippy -- -Dwarnings | |
upcoming_version: | |
runs-on: ubuntu-latest | |
container: tartar4s/semver-ci:v0.6.1 | |
needs: [ lint ] | |
outputs: | |
UPCOMING_VERSION: ${{ steps.set_upcoming_version.outputs.UPCOMING_VERSION }} | |
steps: | |
- id: set_upcoming_version | |
run: | | |
export SCOPE=$(svci scope) | |
echo "UPCOMING_VERSION=$(svci version)" >> "$GITHUB_OUTPUT" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
needs: [ upcoming_version ] | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: tartar4s/semver-ci | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./debug.Dockerfile | |
push: true | |
tags: tartar4s/semver-ci:${{needs.upcoming_version.outputs.UPCOMING_VERSION}} | |
labels: ${{ steps.meta.outputs.labels }} | |
release_candidate: | |
runs-on: ubuntu-latest | |
container: tartar4s/semver-ci:v0.6.1 | |
if: startsWith(github.ref_name, 'release/') || startsWith(github.ref_name, 'hotfix/') | |
needs: [ upcoming_version, push_to_registry ] | |
permissions: | |
contents: write | |
steps: | |
- run: svci release "$RELEASE_NAME" | |
env: | |
RELEASE_NAME: ${{needs.upcoming_version.outputs.UPCOMING_VERSION}} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DESCRIPTION: | | |
## Artifacts | |
- Container image: tartar4s/semver-ci:${{needs.upcoming_version.outputs.UPCOMING_VERSION}} | |
GENERATE_RELEASE_NOTES: true |