-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add release workflow #5
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7217fca
add release workflow
artyorsh 0b0f7b7
install required dependencies
artyorsh 3c197ee
fill galaxy.yml
artyorsh e7c7968
add meta/runtime.yml
artyorsh a3d8c57
update release.yml
artyorsh ff23ec3
add write permissions
artyorsh 9382f83
v1.0.0-dev
artyorsh fe8e54f
tmp: run on pull_request to feat/docs
artyorsh dfb570e
tmp
artyorsh bc47044
fix usage of needs.git_tag
artyorsh 3650b59
fix publish script
artyorsh c203e72
publish git tag together with galaxy
artyorsh 833eb87
fix GALAXY_API_KEY usage
artyorsh b554698
--token --> --api-key
artyorsh f4ef01f
publish to the public server
artyorsh c48afd7
try without deps?
artyorsh 9d94704
trigger on push to master
artyorsh 7d5d4a0
remove redundant actions permissions
artyorsh 0b71496
Revert "trigger on push to master"
artyorsh fa5436d
Reapply "trigger on push to master"
artyorsh b229617
update publish to galaxy step name
artyorsh b4d6579
fix linter issues
artyorsh 9e9cb45
update license block
artyorsh 1932447
remove comments
artyorsh ec5ecf3
add galaxy badge
artyorsh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
name: "Release" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
permissions: | ||
contents: "write" | ||
|
||
jobs: | ||
|
||
check_version_update: | ||
runs-on: "ubuntu-latest" | ||
|
||
outputs: | ||
version: ${{ steps.galaxy_yml_version.outputs.value }} | ||
is_updated: ${{ steps.compare_versions.outputs.value }} | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
||
- name: "Install PyYAML" | ||
run: pip install pyyaml | ||
|
||
- name: "Read version from galaxy.yml" | ||
id: galaxy_yml_version | ||
run: | | ||
import yaml | ||
with open('galaxy.yml', 'r') as file: | ||
data = yaml.safe_load(file) | ||
print(f"version={data['version']}") | ||
print(f"::set-output name=value::{data['version']}") | ||
shell: "python" | ||
|
||
- name: "Compare with latest git tag" | ||
id: compare_versions | ||
run: | | ||
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo 'v0.0.0') | ||
|
||
if [[ "${{ steps.galaxy_yml_version.outputs.value }}" != "$latest_tag" ]]; then | ||
echo "::set-output name=value::true" | ||
else | ||
echo "::set-output name=value::false" | ||
fi | ||
|
||
publish: | ||
runs-on: "ubuntu-latest" | ||
needs: check_version_update | ||
if: needs.check_version_update.outputs.is_updated == 'true' | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
||
- name: "Build the Collection" | ||
run: ansible-galaxy collection build | ||
|
||
- name: "Publish to Galaxy" | ||
run: >- | ||
ansible-galaxy collection publish | ||
--api-key ${{ secrets.GALAXY_API_KEY }} | ||
./artyorsh-smarthome-${{ needs.check_version_update.outputs.version }}.tar.gz | ||
|
||
- name: "Publish a new tag" | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git tag ${{ needs.check_version_update.outputs.version }} | ||
git push origin ${{ needs.check_version_update.outputs.version }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,33 @@ | ||
--- | ||
### REQUIRED | ||
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all | ||
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with | ||
# underscores or numbers and cannot contain consecutive underscores | ||
namespace: artyorsh | ||
|
||
# The name of the collection. Has the same character restrictions as 'namespace' | ||
name: smarthome | ||
|
||
# The version of the collection. Must be compatible with semantic versioning | ||
version: 1.0.0 | ||
version: 1.0.0-dev | ||
|
||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection | ||
readme: README.md | ||
|
||
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url) | ||
# @nicks:irc/im.site#channel' | ||
authors: | ||
- your name <[email protected]> | ||
- artyorsh | ||
|
||
|
||
### OPTIONAL but strongly recommended | ||
# A short summary description of the collection | ||
description: your collection description | ||
|
||
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only | ||
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' | ||
license: | ||
- GPL-2.0-or-later | ||
|
||
# The path to the license file for the collection. This path is relative to the root of the collection. This key is | ||
# mutually exclusive with 'license' | ||
license_file: '' | ||
|
||
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character | ||
# requirements as 'namespace' and 'name' | ||
tags: [] | ||
- MIT | ||
|
||
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the | ||
# collection label 'namespace.name'. The value is a version range | ||
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version | ||
# range specifiers can be set and are separated by ',' | ||
dependencies: {} | ||
tags: | ||
- smarthome | ||
- iot | ||
- homeassistant | ||
- zigbee2mqtt | ||
- mosquitto | ||
|
||
# The URL of the originating SCM repository | ||
repository: http://example.com/repository | ||
dependencies: | ||
"community.docker": ">=3.0.0" | ||
|
||
# The URL to any online docs | ||
documentation: http://docs.example.com | ||
repository: https://github.com/artyorsh/ansible-collection-smarthome | ||
documentation: https://github.com/artyorsh/ansible-collection-smarthome | ||
homepage: https://artyorsh.me | ||
issues: https://github.com/artyorsh/ansible-collection-smarthome/issues | ||
|
||
# The URL to the homepage of the collection/project | ||
homepage: http://example.com | ||
|
||
# The URL to the collection issue tracker | ||
issues: http://example.com/issue/tracker | ||
|
||
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build | ||
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This | ||
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry', | ||
# and '.git' are always filtered. Mutually exclusive with 'manifest' | ||
build_ignore: [] | ||
|
||
# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a | ||
# list of MANIFEST.in style | ||
# L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key | ||
# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive | ||
# with 'build_ignore' | ||
# manifest: null |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
requires_ansible: ">=2.17.3" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO in #1