Skip to content

Commit

Permalink
release.yml initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
fromkk committed May 22, 2021
1 parent 31bd17e commit d1ffdd9
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Upload Release Archive

on:
push:
tags:
- "[0-9]+\\.[0-9]+\\.[0-9]+"

jobs:
build:
name: Upload Release Asset
runs-on: macos-latest
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
echo "Version $VERSION"
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true

- name: Generate Xcode project and install Pods
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
swift package generate-xcodeproj
- name: Archive
run: |
zip -r ${{ steps.version.outputs.filename }}.zip ./ -x "*.git*"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.version.outputs.filename }}.zip
asset_name: ${{ steps.version.outputs.filename }}.zip
asset_content_type: application/zip

0 comments on commit d1ffdd9

Please sign in to comment.