Skip to content

Commit

Permalink
refactor: to nanocl 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed May 22, 2023
1 parent e5ce167 commit 3a267ee
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 73 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/draft_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Draft Stable c2ncl

on:
push:
branches:
- "release-stable-*"
pull_request:
branches:
- "release-stable-*"
types: [opened, synchronize, closed]

env:
CARGO_TERM_COLOR: always

jobs:
release_image:
runs-on: ubuntu-latest
container: rust:1.69.0-alpine3.17

steps:
# Install required dependencies
- name: Install dependencies
run: |
apk add --update alpine-sdk musl-dev g++ make libpq-dev openssl-dev git upx perl build-base dpkg pandoc github-cli
rustup target add x86_64-unknown-linux-musl
- uses: actions/checkout@v3
# Extract branch info
- name: Set info
run: |
echo "BINARY_NAME=c2ncl" >> $GITHUB_ENV
echo "CHANNEL=$(echo ${GITHUB_REF##*/} | awk -F- '{print $2}')" >> $GITHUB_ENV
echo "VERSION=$(echo ${GITHUB_REF##*/} | awk -F- '{print $3}')" >> $GITHUB_ENV
# Fix git permission
- name: Fix git permission
run: |
git config --global --add safe.directory /__w/c2ncl/c2ncl
# Print info for debug
- name: Print Info
run: |
echo $BINARY_NAME
echo $CHANNEL
echo $VERSION
# Package c2ncl into a .deb
- name: Package
run: ./scripts/release.sh
- name: Test if release already exists
id: release-exists
continue-on-error: true
run: gh release view $BINARY_NAME-$VERSION
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Create new draft release
if: steps.release-exists.outcome == 'failure' && steps.release-exists.conclusion == 'success'
run: gh release create -R nxthat/c2ncl -d $BINARY_NAME-$VERSION -t $BINARY_NAME-$VERSION -F changelog.md target/debian/${BINARY_NAME}_${VERSION}_amd64.deb#c2ncl_amd64.deb
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Update draft release
if: steps.release-exists.outcome == 'success' && steps.release-exists.conclusion == 'success'
run: |
gh release delete-asset -R nxthat/c2ncl -y $BINARY_NAME-$VERSION ${BINARY_NAME}_${VERSION}_amd64.deb || true
gh release upload -R nxthat/c2ncl $BINARY_NAME-$VERSION target/debian/${BINARY_NAME}_${VERSION}_amd64.deb#c2ncl_amd64.deb
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
Loading

0 comments on commit 3a267ee

Please sign in to comment.