From cd2f14e1fc92197a54e5eb5e133602ed977484c4 Mon Sep 17 00:00:00 2001 From: cmrxnn Date: Sun, 15 Oct 2023 19:03:12 +0100 Subject: [PATCH] create release ci github --- .github/workflows/release.yml | 62 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b3c982d --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/package.json b/package.json index 694ca92..aa774b9 100644 --- a/package.json +++ b/package.json @@ -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",