-
Notifications
You must be signed in to change notification settings - Fork 8
67 lines (64 loc) · 1.77 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Main
on:
push:
branches:
- main
paths-ignore:
- 'helm/**'
jobs:
test_branch:
name: Test Main
uses: ./.github/workflows/test.yml
next_version:
name: Next Version
runs-on: ubuntu-latest
needs:
- test_branch
steps:
- name: Checkout with deploy key
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.CI_TAG_DEPLOY_KEY }}
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags
- name: Setup Conventional Versioning
uses: jontze/.workflows/setup-conventional-versioning@main
with:
version: v0.1.0
- uses: taiki-e/install-action@v2
with:
tool: cargo-binstall
- name: Install Cargo-Edit
run: |
cargo binstall cargo-edit --no-confirm
- name: Specify next version
id: next
run: |
echo "version=$(conventional-versioning -o plain)" >> $GITHUB_OUTPUT
- name: Set Cargo version
run: |
cargo set-version ${{ steps.next.outputs.version }}
- name: Commit Version Bump (if changed)
uses: stefanzweifel/git-auto-commit-action@v5
id: commit
with:
commit_message: "chore(version): Bump version to ${{ steps.next.outputs.version }}"
- name: Create Tag
if: steps.commit.outputs.changes_detected == 'true'
run: |
git tag v${{ steps.next.outputs.version }}
git push origin v${{ steps.next.outputs.version }}
publish_main_image:
permissions:
contents: read
packages: write
needs:
- test_branch
name: Publish Main image
uses: ./.github/workflows/image.yml
with:
user: jontze
push: true
cache_tag: main
secrets: inherit