From 9870d48124da805820c70ebc6ba563c715551019 Mon Sep 17 00:00:00 2001 From: Pascal Zimmermann Date: Sun, 10 Mar 2024 20:39:20 +0100 Subject: [PATCH] Update the release process and setup the process to specify tags (#145) * feat: Update the release process * feat: Update the GH action checkout version --- .github/workflows/build.yml | 2 +- .github/workflows/monitoring_link.yml | 2 +- .github/workflows/publish.yml | 23 +++++++++++++++++++++++ README.md | 14 +++++++------- 4 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0819c9d..5a8ff8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Verify action syntax # The action should not publish any real changes, but should succeed. uses: './' diff --git a/.github/workflows/monitoring_link.yml b/.github/workflows/monitoring_link.yml index 080935d..dcbb60b 100644 --- a/.github/workflows/monitoring_link.yml +++ b/.github/workflows/monitoring_link.yml @@ -13,7 +13,7 @@ jobs: name: Validate links runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Validate links uses: ad-m/report-link-action@master with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..44b82ce --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish + +on: + release: + types: [ published ] + +jobs: + + publish: + name: Publish the release version + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository and the branch + uses: actions/checkout@v4 + + - name: Setup the release version and overwrite the existing major version tag + run: | + major_version=$(echo $GITHUB_REF_NAME | cut -d. -f1) + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git tag -fa $major_version -m "Update $major_version tag and add version $GITHUB_REF_NAME to it" + git push origin $major_version --force \ No newline at end of file diff --git a/README.md b/README.md index 732f97e..3accaa5 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 @@ -124,7 +124,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 @@ -146,7 +146,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 @@ -176,7 +176,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 @@ -201,7 +201,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 @@ -226,7 +226,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} persist-credentials: true @@ -252,7 +252,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0