-
-
Notifications
You must be signed in to change notification settings - Fork 32
54 lines (54 loc) · 1.85 KB
/
create-release.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
# https://github.com/softprops/action-gh-release
name: Create Release
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "package.json"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # [!] we need to checkout with tags and commit history
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: "x64" # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
- name: 📋 Get Commits since last Release
id: changes
uses: simbo/[email protected]
with:
line-prefix: "* "
include-hashes: false
- name: Generate new release version
id: newversion
run: python default.py --create-release "${{ steps.changes.outputs.last-tag }}"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
provenance: false
tags: ${{ secrets.DOCKERHUB_USERNAME }}/webperf-core:v${{ env.NEW_VERSION }},${{ secrets.DOCKERHUB_USERNAME }}/webperf-core:latest
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: "${{ env.NEW_VERSION }}"
make_latest: "true"
generate_release_notes: true