Skip to content

Commit

Permalink
Add create_release.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmyt committed Aug 30, 2024
1 parent a6903fc commit 1e0a3a8
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Upload the latest release

on:
push:
tags: [ "v*" ]

jobs:
create:
name: "Creates the newest release by version"
runs-on: "ubuntu-latest"

steps:
- name: Checkout project
uses: actions/checkout@v2.3.4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Build
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get version from tag
id: get_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"

- name: Update package.json version
run: |
jq ".version = \"${{ steps.get_version.outputs.version }}\"" package.json > tmp.json
mv tmp.json package.json
- name: Commit version change
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
git add package.json
git commit -m "Update version to ${{ steps.get_version.outputs.version }}"
git push origin HEAD:${{ github.ref }}
- name: Create GitHub Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: Release ${{ steps.get_version.outputs.version }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: |
germannewsmaker/nexterm:latest
germannewsmaker/nexterm:${{ steps.get_version.outputs.version }}

0 comments on commit 1e0a3a8

Please sign in to comment.