forked from orange-cloudfoundry/bosh-release-action
-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (89 loc) · 3.9 KB
/
on-commit.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: on-commit
on:
workflow_dispatch:
push:
jobs:
build:
name: "Test dev and final release creation"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ./create-bosh-release-action
- name: Checkout repository test repo
id: checkout_test_repo
uses: actions/checkout@v4
with:
repository: 'orange-cloudfoundry/create-bosh-release-action-test-boshrelease'
fetch-depth: 0
# ref: v1.0
token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }}
path: ./create-bosh-release-action-test-boshrelease
- name: Setup test
run: |
git clone create-bosh-release-action-test-boshrelease dev-release-creation-test
git clone create-bosh-release-action-test-boshrelease final-release-creation-test
- name: Test dev release creation
id: test_dev_release
uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow
with:
target_branch: main
dir: dev-release-creation-test
- name: Generated test dev files status
run: |
ls -lrt
cd dev-release-creation-test
echo "Display dev-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:"
git status
echo "List existing tags:"
git tag --list
cd ..
- name: Test final release creation existing tag
id: test_final_release
uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow
with:
repository: orange-cloudfoundry/create-bosh-release-action-test-boshrelease
token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }}
target_branch: main
dir: final-release-creation-test
tag_name: "0.1.0"
override_existing: "true"
debug: 1
- name: Generated final files status - override
run: |
ls -lrt
cd final-release-creation-test
echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:"
git status
echo "List existing tags:"
git tag --list
cd ..
- name: Get Next Version
id: semver-final-release
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
- name: Test final release creation new tag
id: test_final_new_release
uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow
with:
repository: orange-cloudfoundry/create-bosh-release-action-test-boshrelease
token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }}
target_branch: main
dir: final-release-creation-test
tag_name: "${{ steps.semver-final-release.outputs.nextStrict }}"
override_existing: "false"
debug: 1
- name: Generated final files status - new
run: |
ls -lrt
cd final-release-creation-test
echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:"
git status
echo "List existing tags:"
git tag --list
cd ..