-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from pollenjp/main-pre
v0.1.4
- Loading branch information
Showing
7 changed files
with
165 additions
and
3 deletions.
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,44 @@ | ||
--- | ||
name: Release Drafter (autolabeler & check release tag) | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main* | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
permissions: | ||
contents: read | ||
jobs: | ||
call_autolabel_workflow: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
uses: ./.github/workflows/pull_request_release.yml | ||
check_release_version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
# https://github.com/actions/checkout | ||
uses: actions/checkout@v4 | ||
- name: Extract package version | ||
id: package_version | ||
# https://github.com/freshautomations/stoml/releases | ||
env: | ||
STOML_VERSION: 0.7.1 | ||
run: | | ||
set -eux -o pipefail | ||
wget -O stoml "https://github.com/freshautomations/stoml/releases/download/v${STOML_VERSION}/stoml_linux_amd64" | ||
chmod +x stoml | ||
package_version=$(./stoml pyproject.toml project.version) | ||
echo "package_version=${package_version}" >> $GITHUB_OUTPUT | ||
- name: Check the tag is new and doesn't exist | ||
run: | | ||
set -eux -o pipefail | ||
package_version="${{ steps.package_version.outputs.package_version }}" | ||
if git fetch origin "refs/tags/v${package_version}"; then | ||
echo "${package_version} tag already exists!" >&2 | ||
exit 1 | ||
fi |
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,31 @@ | ||
--- | ||
# | ||
# PRs for release/* branch | ||
# | ||
name: Release Drafter (autolabeler) | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- release/* | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
workflow_call: | ||
permissions: | ||
contents: read | ||
jobs: | ||
autolabel: | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create a PRs message | ||
# https://github.com/release-drafter/release-drafter | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter-autolabel.yml | ||
publish: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,41 @@ | ||
name: Release Drafter | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Extract package version | ||
id: package_version | ||
# https://github.com/freshautomations/stoml/releases | ||
env: | ||
STOML_VERSION: 0.7.1 | ||
run: | | ||
set -eux -o pipefail | ||
wget -O stoml "https://github.com/freshautomations/stoml/releases/download/v${STOML_VERSION}/stoml_linux_amd64" | ||
chmod +x stoml | ||
package_version=$(./stoml pyproject.toml project.version) | ||
echo "PACKAGE_VERSION=${package_version}" >> $GITHUB_OUTPUT | ||
- name: Push tag | ||
run: | | ||
set -eux -o pipefail | ||
git tag v${{ steps.package_version.outputs.package_version }} | ||
git push origin refs/tags/v${{ steps.package_version.outputs.package_version }} | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter.yml | ||
version: ${{ steps.package_version.outputs.PACKAGE_VERSION }} | ||
publish: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,46 @@ | ||
--- | ||
name: Release Drafter (autolabeler & check release tag) | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main-pre | ||
permissions: | ||
contents: read | ||
jobs: | ||
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-pypi | ||
release-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rye and build package | ||
run: | | ||
set -eux -o pipefail | ||
curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" bash | ||
source "${HOME}/.rye/env" | ||
make build | ||
- name: upload windows dists | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
test-pypi-publish: # https://github.com/pypa/gh-action-pypi-publish | ||
name: Upload release to TestPyPI | ||
runs-on: ubuntu-latest | ||
needs: | ||
- release-build | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/ansible-lint-custom-strict-naming | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Retrieve release distributions | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
- name: Publish release distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
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
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