This repository has been archived by the owner on Apr 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (#112) Add Git aliases, switch from Travis to GitHub Actions; * (#113) Fix the Publish Docker workflow; * (#114) Upgrade to `Ubuntu 20.10`, remove redundant parts; * (#117) Switch to Podman for building OCI compliant containers; * (#120) Rewrite the workflow scripts; * (#121) Update the contents; * (#122) Hide the output when installing Rust.
- Loading branch information
Showing
32 changed files
with
283 additions
and
327 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
#!/bin/bash | ||
|
||
# A script to build and push the image | ||
|
||
# Build the image | ||
podman build --squash-all -t $IMAGENAME . | ||
|
||
# Login to the GHCR | ||
echo $GHCR_PAT | podman login ghcr.io -u $USERNAME --password-stdin | ||
|
||
# Push the latest version | ||
podman push $IMAGENAME ghcr.io/$OWNER/$IMAGENAME:latest | ||
|
||
# Push the release version | ||
if [ "$PUBLISH_RELEASE_VERSION" = true ]; then | ||
podman push dev ghcr.io/$OWNER/$IMAGENAME:$RELEASE_VERSION | ||
fi |
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,49 @@ | ||
#!/bin/bash | ||
|
||
# A script to determine whether a | ||
# release version should be pushed | ||
|
||
# Get last published version | ||
LAST_VERSION=$(curl --silent "https://api.github.com/repos/$REPOSITORY/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') | ||
|
||
# Check if there is some tag | ||
if [ ! -z "$LAST_VERSION" ]; then | ||
|
||
# Get current tag | ||
CURRENT_TAG=$(echo ${GITHUB_REF#refs/*/}) | ||
|
||
# Print info | ||
echo -e "\n\e[1;36mLast version: $LAST_VERSION\e[0m" | ||
echo -e "\e[1;36mCurrent tag: $CURRENT_TAG\e[0m\n" | ||
|
||
# Check if the tag is a semantic version | ||
if echo "$CURRENT_TAG" | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$"; then | ||
|
||
# Print information | ||
echo -e "\e[1;36mCurrent tag is a semantic version. Tagged image will be published.\e[0m\n" | ||
|
||
# Set environment variable | ||
echo "RELEASE_VERSION=$(echo $CURRENT_TAG | sed 's/v//')" >> $GITHUB_ENV | ||
|
||
# Publish tagged image | ||
echo "PUBLISH_RELEASE_VERSION=true" >> $GITHUB_ENV | ||
|
||
else | ||
|
||
# Print information | ||
echo -e "\e[1;36mCurrent tag is not a semantic version. Tagged image will not be published.\e[0m\n" | ||
|
||
# Don't publish tagged image | ||
echo "PUBLISH_RELEASE_VERSION=false" >> $GITHUB_ENV | ||
|
||
fi | ||
|
||
else | ||
|
||
# Print information | ||
echo -e "\n\e[1;36mNo release has been found, tagged version will not be published.\e[0m\n" | ||
|
||
# Don't publish tagged image | ||
echo "PUBLISH_RELEASE_VERSION=false" >> $GITHUB_ENV | ||
|
||
fi |
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,15 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@master | ||
- name: Build the image | ||
run: podman build --squash-all -t dev . |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- develop | ||
|
||
env: | ||
GHCR_PAT: ${{ secrets.GHCR_PAT }} | ||
IMAGENAME: ${{ github.event.repository.name }} | ||
OWNER: ${{ github.repository_owner }} | ||
REPOSITORY: ${{ github.repository }} | ||
USERNAME: ${{ github.actor }} | ||
|
||
jobs: | ||
Publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@master | ||
- name: Determine whether to upload a release version | ||
run: bash .github/scripts/version.bash | ||
- name: Publish to GHCR | ||
run: bash .github/scripts/publish.bash |
6 changes: 3 additions & 3 deletions
6
.github/workflows/release-drafter.yml → .github/workflows/release.yml
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
name: Release Drafter | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
update: | ||
Release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: config/release-drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.