Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b64836

Browse files
committed
Implementing Release Action
1 parent ddd3862 commit 5b64836

4 files changed

Lines changed: 47 additions & 39 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165

166166
publish:
167167
name: Deploy documentation
168-
needs: [build-and-test]
168+
needs: [ build-and-test ]
169169
concurrency: publish
170170
runs-on: ubuntu-latest
171171
if: |
@@ -207,7 +207,7 @@ jobs:
207207
slack-workflow-status:
208208
if: always()
209209
name: Post Workflow Status To Slack
210-
needs: [build-and-test, publish]
210+
needs: [ build-and-test, publish ]
211211
runs-on: ubuntu-latest
212212
steps:
213213
- name: Slack Workflow Notification
@@ -219,3 +219,4 @@ jobs:
219219
# Optional Input
220220
name: 'Github Actions[bot]'
221221
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'
222+
#TODO - add triggering of builds on other repositories

.github/workflows/release_documentation.yml renamed to .github/workflows/release.yml

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
name: Create and publish release artifacts
2-
env:
3-
PULL_REQUEST_NAME: ${{github.head_ref}}
4-
PULL_REQUEST_BRANCH: ${{github.head_ref}}
5-
REPO_SLUG: ${{github.repository}}
6-
PR_SLUG: ${{github.repository}}
7-
82
on:
93
release:
10-
types: [ created ]
4+
types: [ released ]
115
#See: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-using-multiple-events-with-activity-types-or-configuration
126

137
defaults:
@@ -17,6 +11,7 @@ defaults:
1711
jobs:
1812

1913
publish:
14+
name: Deploy documentation
2015
concurrency: publish
2116
runs-on: ubuntu-latest
2217

@@ -37,9 +32,6 @@ jobs:
3732
git config --global user.email "github-actions[bot]@users.noreply.github.com"
3833
git config --global user.name "github-actions[bot]"
3934
40-
- name: Install MkDocs
41-
run: pip install mkdocs
42-
4335
- name: Update project version & build number in source code and documentation
4436
run: .travis/update_project_version.sh
4537

@@ -48,11 +40,52 @@ jobs:
4840
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
4941
run: .travis/push_docs_to_github_io.sh
5042

43+
upload_artifacts:
44+
name: Upload archives
45+
concurrency: upload
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
with:
51+
fetch-depth: 0
52+
- name: Update project version & build number in source code and documentation
53+
run: .travis/update_project_version.sh
54+
55+
- name: Setup git config
56+
run: |
57+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
58+
git config --global user.name "github-actions[bot]"
59+
60+
- name: Build html documentation
61+
run: |
62+
pip install mkdocs
63+
mkdocs build --clean --strict
64+
rm -rf docs/*
65+
cp -r -v site/* docs
66+
git add .
67+
git commit -m "tmp commit of HTML documentation for building a release archive"
68+
69+
- name: Build release archives
70+
run: |
71+
git archive --prefix=utPLSQL/ -o utPLSQL.zip --format=zip HEAD
72+
git archive --prefix=utPLSQL/ -o utPLSQL.tar.gz --format=tar.gz HEAD
73+
md5sum utPLSQL.zip --tag > utPLSQL.zip.md5
74+
md5sum utPLSQL.tar.gz --tag > utPLSQL.tar.gz.md5
75+
76+
- name: Release
77+
uses: softprops/action-gh-release@v1
78+
with:
79+
files: |
80+
utPLSQL.zip
81+
utPLSQL.zip.md5
82+
utPLSQL.tar.gz
83+
utPLSQL.tar.gz.md5
5184
5285
slack-workflow-status:
5386
if: always()
5487
name: Post Workflow Status To Slack
55-
needs: [publish]
88+
needs: [ publish, upload_artifacts ]
5689
runs-on: ubuntu-latest
5790
steps:
5891
- name: Slack Workflow Notification
@@ -65,5 +98,3 @@ jobs:
6598
name: 'Github Actions[bot]'
6699
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'
67100

68-
# TODO - add building of release archive
69-
# TODO - add publishing of release

.travis/build_docs.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis/build_release_archive.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)