-
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.
Merge pull request #2 from testainers/dev
Version 0.0.1.
- Loading branch information
Showing
7 changed files
with
185 additions
and
169 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 |
---|---|---|
|
@@ -4,54 +4,34 @@ on: | |
branches: [ main ] | ||
|
||
jobs: | ||
######## | ||
# Boot # | ||
######## | ||
boot: | ||
name: Boot | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
outputs: | ||
version: ${{ steps.version-step.outputs.version }} | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get Pubspec Version | ||
id: version-step | ||
run: | | ||
export VERSION=$(grep 'version:' pubspec.yaml | cut -c 10- | cut -f 1 -d '+') | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Check if version is used | ||
run: | | ||
URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest | ||
LATEST=$(curl --silent "$URL" | jq -r .name) | ||
if [ "$LATEST" == "$VERSION" ]; then | ||
echo "Version already used: $VERSION" | ||
URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/${{ env.VERSION }} | ||
echo "$URL" | ||
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL") | ||
if [ "$CODE" != 404 ]; then | ||
echo "Release '$VERSION' already exists. ($CODE)" | ||
exit 1 | ||
fi | ||
########## | ||
# Deploy # | ||
########## | ||
deploy: | ||
name: Deploy | ||
needs: [ boot ] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Flutter Environment | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: Flutter Pub Get | ||
timeout-minutes: 2 | ||
|
@@ -70,11 +50,12 @@ jobs: | |
- name: Creating a GitHub Tag | ||
uses: mathieudutour/[email protected] | ||
with: | ||
custom_tag: ${{ needs.boot.outputs.version }} | ||
custom_tag: ${{ env.VERSION }} | ||
tag_prefix: '' | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create a GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: v${{ needs.boot.outputs.version }} | ||
tag: ${{ env.VERSION }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.