-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 46ca1a7.
- Loading branch information
Showing
6 changed files
with
155 additions
and
127 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 |
---|---|---|
@@ -1,25 +1,16 @@ | ||
# Bump the version of the repo and push the new version in a new commit. | ||
|
||
name: Bump version | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
new_ver: | ||
description: New version number | ||
value: ${{ jobs.bump-version.outputs.new_ver }} | ||
|
||
|
||
jobs: | ||
bump-version: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_ver: ${{ steps.bumper.outputs.new_ver }} | ||
new_tag: ${{ steps.bumper.outputs.new_ver }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Bump version and push tag | ||
id: bumper | ||
uses: jasonamyers/[email protected].5 | ||
uses: jasonamyers/[email protected].3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push changes | ||
|
This file was deleted.
Oops, something went wrong.
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,9 +1,4 @@ | ||
# Shortcut that runs both | ||
# * bump-version.yml | ||
# * docker-release-only.yml | ||
|
||
name: Bump version and auto-release | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
|
@@ -22,13 +17,61 @@ on: | |
|
||
jobs: | ||
bump-version: | ||
uses: openclimatefix/.github/.github/workflows/[email protected] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_tag: ${{ steps.bumper.outputs.new_ver }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Bump version | ||
id: bumper | ||
uses: jasonamyers/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tags: true | ||
|
||
docker-release: | ||
needs: [bump-version] | ||
uses: openclimatefix/.github/.github/workflows/[email protected] | ||
with: | ||
image_base_name: ${{inputs.image_base_name}} | ||
docker_file: ${{inputs.docker_file}} | ||
tag_value: ${{ needs.bump-version.outputs.new_ver }} | ||
secrets: inherit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
- run: echo ${{ needs.bump-version.outputs.new_tag }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
# TODO make more flexible | ||
images: | | ||
openclimatefix/${{ inputs.image_base_name }} | ||
tags: | | ||
type=raw,value=${{ needs.bump-version.outputs.new_tag }} | ||
flavor: | | ||
latest=true | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: openclimatefix | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ${{ inputs.docker_file }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,9 +1,3 @@ | ||
# Shortcut to run the following: | ||
# * bump-version.yml | ||
# * Publish the python package | ||
# * Create a release in github | ||
# * docker-release-only.yml | ||
|
||
name: Bump version and auto-release | ||
on: | ||
workflow_call: | ||
|
@@ -24,14 +18,22 @@ on: | |
default: Dockerfile | ||
|
||
jobs: | ||
bump-version: | ||
uses: openclimatefix/.github/.github/workflows/[email protected] | ||
|
||
build: | ||
needs: [bump-version] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_tag: ${{ steps.bumper.outputs.new_ver }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v2 | ||
- name: Bump version and push tag | ||
id: bumper | ||
uses: jasonamyers/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tags: true | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
|
@@ -49,9 +51,10 @@ jobs: | |
password: ${{ secrets.token }} | ||
|
||
python-release: | ||
needs: [bump-version, build] | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo ${{needs.build.outputs.new_tag}} | ||
- name: Changelog | ||
uses: scottbrenner/generate-changelog-action@master | ||
id: Changelog | ||
|
@@ -63,18 +66,52 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ needs.bump-version.outputs.new_ver }} | ||
release_name: v${{ needs.bump-version.outputs.new_ver }} | ||
tag_name: v${{ needs.build.outputs.new_tag }} | ||
release_name: v${{ needs.build.outputs.new_tag }} | ||
body: | | ||
${{ steps.Changelog.outputs.changelog }} | ||
draft: false | ||
prerelease: false | ||
|
||
docker-release: | ||
needs: [bump-version, build, python-release] | ||
uses: openclimatefix/.github/.github/workflows/[email protected] | ||
with: | ||
image_base_name: ${{inputs.image_base_name}} | ||
docker_file: ${{inputs.docker_file}} | ||
tag_value: ${{ needs.bump-version.outputs.new_ver }} | ||
secrets: inherit | ||
needs: [build, python-release] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
- run: echo ${{ needs.build.outputs.new_tag }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
# TODO make more flexible | ||
images: | | ||
openclimatefix/${{ inputs.image_base_name }} | ||
tags: | | ||
type=raw,value=${{ needs.build.outputs.new_tag }} | ||
flavor: | | ||
latest=true | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: openclimatefix | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ${{ inputs.docker_file }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,17 +1,22 @@ | ||
name: Bump version and auto-release | ||
on: | ||
workflow_call: | ||
inputs: | ||
workdir: | ||
description: 'The directory of the root of the python project' | ||
default: '.' | ||
required: false | ||
type: string | ||
secrets: | ||
token: | ||
required: true | ||
|
||
jobs: | ||
bump-version: | ||
uses: openclimatefix/.github/.github/workflows/[email protected] | ||
|
||
build: | ||
needs: [bump-version] | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.workdir }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -27,15 +32,30 @@ jobs: | |
run: python -m build | ||
|
||
publish: | ||
needs: [bump-version, build] | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.workdir }} | ||
needs: ["build"] | ||
outputs: | ||
new_tag: ${{ steps.bumper.outputs.new_ver }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Bump version | ||
id: bumper | ||
uses: jasonamyers/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SOURCE: ${{ inputs.workdir }} | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tags: true | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
|
@@ -51,13 +71,14 @@ jobs: | |
with: | ||
user: __token__ | ||
password: ${{ secrets.token }} | ||
packages_dir: ./dist | ||
packages_dir: ${{ inputs.workdir }}/dist | ||
|
||
release: | ||
needs: [bump-version, publish] | ||
needs: [publish] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: echo ${{needs.publish.outputs.new_tag}} | ||
- name: Changelog | ||
uses: scottbrenner/generate-changelog-action@master | ||
id: Changelog | ||
|
@@ -69,8 +90,8 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ needs.bump-version.outputs.new_ver }} | ||
release_name: v${{ needs.bump-version.outputs.new_ver }} | ||
tag_name: v${{ needs.publish.outputs.new_tag }} | ||
release_name: v${{ needs.publish.outputs.new_tag }} | ||
body: | | ||
${{ steps.Changelog.outputs.changelog }} | ||
draft: false | ||
|
Oops, something went wrong.