Skip to content

Commit

Permalink
AG-37280 Create GitHub release on release build automatically
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 43529e7
Author: jellizaveta <[email protected]>
Date:   Wed Nov 6 19:11:34 2024 +0300

    remove redundant step

commit 6522fe8
Author: jellizaveta <[email protected]>
Date:   Wed Nov 6 18:45:57 2024 +0300

    remove redundant step

commit 67dbd69
Author: jellizaveta <[email protected]>
Date:   Wed Nov 6 17:54:04 2024 +0300

    AG-37280 Create GitHub release on release build automatically
  • Loading branch information
jellizaveta committed Nov 6, 2024
1 parent 0b87eaa commit 7dd50f1
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Github Release

env:
NODE_VERSION: 20

# Workflow need write access to the repository to create a GitHub release
permissions:
contents: write

on:
push:
tags:
- v*
# Make possible to run manually
workflow_dispatch:
inputs:
# warn before running manually
warning:
description: 'Should be run only for tags like `v*`'
required: false
type: boolean

# Make sure that only one release workflow runs at a time.
concurrency:
group: release

jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
# Only run this job for v* tags
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: yarn

- name: Install dependencies
run: yarn install

- name: Run ESLint
run: yarn lint

- name: Release on GitHub
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
body: See [CHANGELOG.md](./CHANGELOG.md) for the list of changes.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify:
name: Send Slack notification
needs: release
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{
always() &&
github.repository == 'AdguardTeam/DisableAMP' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
}}
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ needs.release.result }}
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 7dd50f1

Please sign in to comment.