Skip to content

Commit

Permalink
create release ci github
Browse files Browse the repository at this point in the history
  • Loading branch information
cmrxnn committed Oct 15, 2023
1 parent 77e4693 commit cd2f14e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
tags:
- "v*"

jobs:
eslint:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Code Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Add pkg
run: npm i -g pkg json

- name: Install Dependencies
run: yarn install

- name: Run Build
run: yarn build

- name: Create release branch and bump version
env:
REF: ${{ github.ref }}
run: |
BRANCH=release/${REF:10}
git config --local user.email "ci@influx.cameronwhite.co.uk"
git config --local user.name "Influx CI"
git checkout -b $BRANCH
git push -u origin $BRANCH
json -I -f package.json -e "this.version='v${REF:11}'"
git add package.json
git commit -m "ci: create release"
git push
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}

- name: Upload release archive
id: upload-release-archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: influx-agent
asset_name: influx-agent
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "influx-agent",
"private": false,
"license": "MIT",
"version": "v0.0.1a",
"version": "develop",
"main": "src/index.js",
"author": "Cameron White <@cmrxnn>",
"repository": "https://github.com/cmrxnn/influx-agent",
Expand Down

0 comments on commit cd2f14e

Please sign in to comment.