proxy.pac.test/.github/workflows/build-and-release.yml

52 lines
1.2 KiB
YAML
Raw Normal View History

2024-10-07 01:30:54 +00:00
name: Build and Release Proxy.pac
on:
push:
branches:
- "main"
schedule:
- cron: "0 0 * * 0"
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Run build script
run: |
chmod +x ./build.sh
./build.sh
- name: Get current date
id: get_date
run: echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "latest"
release_name: "Proxy PAC Release - ${{ env.RELEASE_DATE }}"
draft: false
prerelease: false
- name: Upload Proxy.pac to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
asset_path: ./proxy.pac
asset_name: proxy.pac
asset_content_type: application/x-ns-proxy-autoconfig