-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |